-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
3.6.12
-
None
I have a had a report of a scenario where it looks like the UDP#PacketReceiver is stuck spinning in a busy loop. The following is a snippet of the log file from the system in question.
2018-03-16 14:05:43,273 SEVERE [] (214,unicast receiver,shared=udp) JGRP000190: failed receiving packet java.net.SocketException: socket closed at java.net.TwoStacksPlainDatagramSocketImpl.peekData(Native Method) at java.net.DatagramSocket.receive(DatagramSocket.java:743) at org.jgroups.protocols.UDP$PacketReceiver.run(UDP.java:694) at java.lang.Thread.run(Thread.java:748) 2018-03-16 14:05:43,273 SEVERE [] (214,unicast receiver,shared=udp) JGRP000190: failed receiving packet java.net.SocketException: socket closed at java.net.TwoStacksPlainDatagramSocketImpl.peekData(Native Method) at java.net.DatagramSocket.receive(DatagramSocket.java:743) at org.jgroups.protocols.UDP$PacketReceiver.run(UDP.java:694) at java.lang.Thread.run(Thread.java:748) 2018-03-16 14:05:43,273 SEVERE [] (214,unicast receiver,shared=udp) JGRP000190: failed receiving packet java.net.SocketException: socket closed at java.net.TwoStacksPlainDatagramSocketImpl.peekData(Native Method) at java.net.DatagramSocket.receive(DatagramSocket.java:743) at org.jgroups.protocols.UDP$PacketReceiver.run(UDP.java:694) at java.lang.Thread.run(Thread.java:748)
Looking at the code it looks like the call to receive a packet
receiver_socket.receive(packet);
results in an exception being thrown because the socket is closed but then when the exception is caught
if(receiver_socket.isClosed()) {
method is queried which says the socket has not been closed and the loop then continues for ever.
I guess this is related to JGRP-1669. To quote
I hope there is no condition which causes the socket receive() to spit out endless exceptions while not being closed...