Closed GoogleCodeExporter closed 9 years ago
Can be fixed by adding interrupt call:
---
a/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPT
ransportClient.java
+++
b/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPT
ransportClient.java
@@ -231,6 +231,7 @@ public class TCPTransportClient implements Runnable {
socketChannel.close();
}
if (selfThread != null) {
+ selfThread.interrupt();
selfThread.join(100);
}
clearBuffer();
Original comment by koza...@gmail.com
on 5 Jun 2014 at 5:47
I suffer from the same issue.
I noticed the TCPReader thread is stuck when I disconnect from a peer, it seems
to work fine on windows, but for some reason, on CentOS it keeps waiting most
of the time.
I also confirm the proposed fix works like a charm.
Thanks !
Original comment by nicolas....@gmail.com
on 10 Jun 2014 at 1:43
Forgot to mention, I'm using jdiameter 1.5.10.0-build639
Original comment by nicolas....@gmail.com
on 10 Jun 2014 at 1:44
By adding the interrupt call, there are other issues that arise such as due to
the interruption, the DISCONNECT_EVENT is not put into the queue and that will
cause side-effects when trying to reconnect. The problem can be seen in the
org.mobicents.diameter.stack.StackReConnectionTest.testClientReconnectOnServerRe
start() test.
Original comment by brainslog
on 4 Jul 2014 at 3:07
Just for confirmation, we run into the same problem recently. I have a network
trace as well that shows that the server replies with a successful CEA but the
client never reads it from the socket leading to a TIMEOUT event.
Original comment by atouloupis
on 4 Jul 2014 at 12:08
Hi,
So is this issue is fixed or not? If yes where i can find sources?
thank you.
Original comment by sirius....@gmail.com
on 22 Jul 2014 at 10:46
Good day
I guess to avoid issue with DISCONNECT_EVENT you should not add
selfThread.interrupt(); to stop() method of
org.jdiameter.client.impl.transport.tcp.TCPTransportClient.
But instead of this in method run() (class TCPTransportClient) in main cycle:
while (!stop) {
selector.select();
...
use select method with timeout just like this:
selector.select(1000);
In my tests after such fix connection normally reinit after missing DWA and
putting DISCONNECT_EVENT to queue seems working normally.
Please comment.
Thank you
Original comment by sirius....@gmail.com
on 30 Jul 2014 at 12:54
I try solution with setting timeout in Selector and... peers reconnect without
any side effects. I mean amount of TCP sockets, which was created in
REOPEN<->INITIAL state back to normal and messages was exchanged properly.
Thanks for this :)
In my opinion, it is acceptable answer but I will wait for response from
brainslog.
Original comment by markiewiczr89
on 5 Aug 2014 at 1:40
I agree the select should be used with the timeout, it's a much better
solution. But I'd use a smaller value.. 1 second is a bit of time, I'm using
500 ms instead. Tests are also confirming to be ok, will commit this as fix.
Is any of you who were able to replicate the problem be able to write a
regression test (based on the ones from
org.mobicents.diameter.stack.StackReConnectionTest) ? Would be greatly
appreciated.
Original comment by brainslog
on 21 Aug 2014 at 1:10
This issue was closed by revision 604e8e9c9184.
Original comment by brainslog
on 21 Aug 2014 at 1:16
Original issue reported on code.google.com by
markiewiczr89
on 31 Mar 2014 at 9:36Attachments: