Issue 72 in jdiameter: Jdiameter SCTP automatic reconnection

8 views
Skip to first unread message

jdia...@googlecode.com

unread,
Feb 26, 2015, 9:49:04 AM2/26/15
to mobicents-all-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 72 by dpalmer...@gmail.com: Jdiameter SCTP automatic reconnection
https://code.google.com/p/jdiameter/issues/detail?id=72


I have been running some client server tests with the jdiameter stack
(Version 1.6.0-FINAL).

The client sends a S6A request to the server which responds with a S6A
answer. If I run the tests over the TCP protocol I can stop and start the
server with the client still running and the client automatically
reconnects to the server. If I repeat the tests over the SCTP protocol then
the client does not reconnect with the client. In the client application
log file I see exceptions of the form:

21 Jan 2015 15:03:47,882 [Thread-2] INFO
org.mobicents.protocols.sctp.SelectorThread -
Association=cookie.ei.lan.3730 connected to=[/10.7.3.65:3868]
21 Jan 2015 15:03:47,882 [Thread-2] INFO
org.mobicents.protocols.sctp.AssociationHandler - New association setup
for Association=cookie.ei.lan.3730 with 32 outbound streams, and 10 inbound
streams.

21 Jan 2015 15:03:47,883 [Thread-2] INFO
org.mobicents.protocols.sctp.AssociationHandler -
Association=cookie.ei.lan.3730 SHUTDOWN
21 Jan 2015 15:03:47,884 [Thread-2] ERROR
org.mobicents.protocols.sctp.AssociationImpl - IOException while trying to
write to underlying socket for Association=cookie.ei.lan.3730 IOError
count=1
java.net.SocketException: Socket is shutdown for writing
at sun.nio.ch.SctpChannelImpl.send0(Native Method)
at
sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971)
at
org.mobicents.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:680)
at
org.mobicents.protocols.sctp.AssociationImpl.doSend(AssociationImpl.java:674)
at
org.mobicents.protocols.sctp.AssociationImpl.write(AssociationImpl.java:593)
at
org.mobicents.protocols.sctp.SelectorThread.write(SelectorThread.java:436)
at
org.mobicents.protocols.sctp.SelectorThread.run(SelectorThread.java:157)
at java.lang.Thread.run(Thread.java:745)
21 Jan 2015 15:03:47,885 [Thread-2] ERROR
org.mobicents.protocols.sctp.AssociationImpl - IOException while trying to
write to underlying socket for Association=cookie.ei.lan.3730 IOError
count=2
java.net.SocketException: Socket is shutdown for writing
at sun.nio.ch.SctpChannelImpl.send0(Native Method)
at
sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971)
at
org.mobicents.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:680)
at
org.mobicents.protocols.sctp.AssociationImpl.doSend(AssociationImpl.java:674)
at
org.mobicents.protocols.sctp.AssociationImpl.write(AssociationImpl.java:593)
at
org.mobicents.protocols.sctp.SelectorThread.write(SelectorThread.java:436)
at
org.mobicents.protocols.sctp.SelectorThread.run(SelectorThread.java:157)
at java.lang.Thread.run(Thread.java:745)
21 Jan 2015 15:03:47,885 [Thread-2] ERROR
org.mobicents.protocols.sctp.AssociationImpl - IOException while trying to
write to underlying socket for Association=cookie.ei.lan.3730 IOError
count=3
java.net.SocketException: Socket is shutdown for writing
at sun.nio.ch.SctpChannelImpl.send0(Native Method)
at
sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971)
at
org.mobicents.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:680)
at
org.mobicents.protocols.sctp.AssociationImpl.doSend(AssociationImpl.java:674)
at
org.mobicents.protocols.sctp.AssociationImpl.write(AssociationImpl.java:593)
at
org.mobicents.protocols.sctp.SelectorThread.write(SelectorThread.java:436)
at
org.mobicents.protocols.sctp.SelectorThread.run(SelectorThread.java:157)
at java.lang.Thread.run(Thread.java:745)
21 Jan 2015 15:03:47,886 [Thread-2] ERROR
org.mobicents.protocols.sctp.AssociationImpl - IOException while trying to
write to underlying socket for Association=cookie.ei.lan.3730 IOError
count=4
java.net.SocketException: Socket is shutdown for writing
at sun.nio.ch.SctpChannelImpl.send0(Native Method)
at
sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971)
at
org.mobicents.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:680)
at
org.mobicents.protocols.sctp.AssociationImpl.doSend(AssociationImpl.java:674)
at
org.mobicents.protocols.sctp.AssociationImpl.write(AssociationImpl.java:593)
at
org.mobicents.protocols.sctp.SelectorThread.write(SelectorThread.java:436)
at
org.mobicents.protocols.sctp.SelectorThread.run(SelectorThread.java:157)
at java.lang.Thread.run(Thread.java:745)
21 Jan 2015 15:03:47,887 [Thread-2] WARN
org.mobicents.protocols.sctp.AssociationImpl - Clearig txQueue for
Association=cookie.ei.lan.3730. 1 messages still pending will be cleared


Using Wireshark I can see the client connecting but the server immediately
responds with a SHUTDOWN message. The following is written in the server
log:

21 Jan 2015 15:54:28,523 [Thread-0] ERROR
org.mobicents.protocols.sctp.SelectorThread - Received connect request for
Association=10.7.3.79:3730 but not started yet. Droping the connection!


After stopping the server if I delete the server SCTP persist file
(<host>_<port>_sctp.xml) then when the server is restarted the client and
server successfully reconnect.

It looks like the server reads the persist file and loads the association
that the client was using before it was stopped. It does not however start
the association. When the client tries to connect to the server it fails as
the association is not started.


Note that the server was stopped with control-c to simulate a hard crash.





--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

jdia...@googlecode.com

unread,
Jul 9, 2015, 3:32:47 PM7/9/15
to mobicents-all-...@googlegroups.com

Comment #1 on issue 72 by hajdua...@gmail.com: Jdiameter SCTP automatic
reconnection
https://code.google.com/p/jdiameter/issues/detail?id=72

I have similar problem. I wrapped original stack with a new class and I use
a shutdownhook...
Reply all
Reply to author
Forward
0 new messages