Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1573

Non-atomic retrieval of seqnos causes IllegalArgumentException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 3.2.7, 3.3
    • 3.2.6
    • None

      In UNICAST2.handleDataReceived the hr and hd arguments are read non-atomically (out of lock) and neither are volatile, therefore, the order of reading the values may be interchanged (even if the values were updated in the correct order, reading delivered prior to received does not help currently). This may lead to later IllegalArgumentException.

      This could be fixed by either requesting the seqnos synchronously or in a loop until hd <= hr holds (and set them to be volatile).

      04:39:37,939 ERROR [org.jgroups.protocols.TCP] (OOB-32,null) failed handling incoming message: java.lang.IllegalArgumentException: low (16456815) needs to be <= high (16456814)
              at org.jgroups.protocols.UNICAST2$Unicast2Header.createStableHeader(UNICAST2.java:1037) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.UNICAST2.sendStableMessage(UNICAST2.java:611) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.UNICAST2.handleDataReceived(UNICAST2.java:754) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.UNICAST2.up(UNICAST2.java:420) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:606) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:143) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.FD.up(FD.java:253) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.MERGE2.up(MERGE2.java:205) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.Discovery.up(Discovery.java:359) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.MPING.up(MPING.java:179) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.TP$ProtocolAdapter.up(TP.java:2642) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.TP.passMessageUp(TP.java:1289) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1852) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1825) [jgroups-3.2.6.Final-redhat-1.jar:3.2.6.Final]
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_33]
              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]
      

              rhn-engineering-bban Bela Ban
              rvansa1@redhat.com Radim Vansa (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: