[jboss-jira] [JBoss JIRA] (JGRP-2257) UDP#PacketReceiver stuck in busy loop when socket throws closed exception but socket is not closed

Paul Illingworth (JIRA) issues at jboss.org
Fri Mar 16 12:14:00 EDT 2018


Paul Illingworth created JGRP-2257:
--------------------------------------

             Summary: UDP#PacketReceiver stuck in busy loop when socket throws closed exception but socket is not closed
                 Key: JGRP-2257
                 URL: https://issues.jboss.org/browse/JGRP-2257
             Project: JGroups
          Issue Type: Bug
    Affects Versions: 3.6.12
         Environment: Windows Server 2016, 32GBytes memory running as a Hyper-V guest
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

It was reported with just a single node running.
            Reporter: Paul Illingworth
            Assignee: Bela Ban


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. 

{noformat}
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)
 {noformat}

Looking at the code it looks like the call to receive a packet 

{code:java}
receiver_socket.receive(packet);
{code}

results in an exception being thrown because the socket is closed but then when the exception is caught 

{code:java}
if(receiver_socket.isClosed()) {
{code}

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..._



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list