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

NullPointerException in NAKACK2 trace message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.2.3
    • 5.2.2
    • None
    • False
    • None
    • False

      When running the Infinispan test suite with TRACE logs enabled, I've noticed a NullPointerException in NAKACK2 log message [1].

      It looks like the trace message expects the NAKACK2 header on the first and the last message in the batch; however, if a STABLE message is the first or the last, it does not contains the NAKACK2 header which leads to the exception.

      Stack used during tests can be found in [2].

      The logs are below.

      // regular and STABLE message batched together
      2022-06-27 18:13:17,083 TRACE (jgroups-9,StateTransferTimestampsTest-NodeA) [org.jgroups.protocols.UDP] StateTransferTimestampsTest-NodeA: sending msg to null, src=StateTransferTimestampsTest-NodeA, size=410, headers are NAKACK2: [MSG, seqno=9], TP: [cluster=org.infinispan.statetransfer.StateTransferTimestampsTest[DIST_SYNC, BINARY]]
      2022-06-27 18:13:17,083 TRACE (jgroups-9,StateTransferTimestampsTest-NodeA) [org.jgroups.protocols.UDP] StateTransferTimestampsTest-NodeA: sending msg to null, src=StateTransferTimestampsTest-NodeA, size=172, headers are STABLE: [STABILITY] view-id= [StateTransferTimestampsTest-NodeA|1], TP: [cluster=org.infinispan.statetransfer.StateTransferTimestampsTest[DIST_SYNC, BINARY]]
      
      // receiver side
      2022-06-27 18:13:17,084 TRACE (jgroups-7,StateTransferTimestampsTest-NodeB) [org.jgroups.protocols.UDP] StateTransferTimestampsTest-NodeB: received message batch of 2 messages from StateTransferTimestampsTest-NodeA
      2022-06-27 18:13:17,086 ERROR (jgroups-7,StateTransferTimestampsTest-NodeB) [org.jgroups.protocols.pbcast.NAKACK2] JGRP000039: StateTransferTimestampsTest-NodeB: failed to deliver batch dest=null, sender=StateTransferTimestampsTest-NodeA, mode=OOB, cluster=org.infinispan.statetransfer.StateTransferTimestampsTest[DIST_SYNC, BINARY], 2 messages [capacity=2]: java.lang.NullPointerException
      java.lang.NullPointerException: null
      	at org.jgroups.protocols.pbcast.NAKACK2.deliverBatch(NAKACK2.java:1001) ~[jgroups-5.2.2.Final.jar:5.2.2.Final]
      	at org.jgroups.protocols.pbcast.NAKACK2.handleMessageBatch(NAKACK2.java:910) ~[jgroups-5.2.2.Final.jar:5.2.2.Final]
      	at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:744) ~[jgroups-5.2.2.Final.jar:5.2.2.Final]
      	at org.jgroups.protocols.Discovery.up(Discovery.java:314) ~[jgroups-5.2.2.Final.jar:5.2.2.Final]
      	at org.jgroups.protocols.RED.up(RED.java:119) ~[jgroups-5.2.2.Final.jar:5.2.2.Final]
      	at org.jgroups.protocols.TP.passBatchUp(TP.java:1188) ~[jgroups-5.2.2.Final.jar:5.2.2.Final]
      	at org.jgroups.util.SubmitToThreadPool$BatchHandler.passBatchUp(SubmitToThreadPool.java:152) ~[jgroups-5.2.2.Final.jar:5.2.2.Final]
      	at org.jgroups.util.SubmitToThreadPool$BatchHandler.run(SubmitToThreadPool.java:148) ~[jgroups-5.2.2.Final.jar:5.2.2.Final]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
      	at java.lang.Thread.run(Thread.java:829) ~[?:?]
      

      [1] https://github.com/belaban/JGroups/blob/c19cc215e66542745c7aaab25a6d9ab52c527d85/src/org/jgroups/protocols/pbcast/NAKACK2.java#L1001
      [2] https://github.com/infinispan/infinispan/blob/699da93844f97b3e96ecd1a83e07544c60f0ebcb/core/src/test/resources/stacks/udp.xml

              rhn-engineering-bban Bela Ban
              pruivo@redhat.com Pedro Ruivo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: