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

Non-thread-safe access to FC.creditors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.4.1 SP2
    • 2.4.1 SP1
    • None

      During load testing of AS HttpSession repl, QE saw RPC transmission errors with the following root cause:

      [JBoss] Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
      [JBoss] at java.util.ArrayList.RangeCheck(ArrayList.java:546)
      [JBoss] at java.util.ArrayList.get(ArrayList.java:321)
      [JBoss] at org.jgroups.protocols.FC.handleDownMessage(FC.java:390)
      [JBoss] at org.jgroups.protocols.FC.down(FC.java:320)
      [JBoss] at org.jgroups.stack.Protocol.receiveDownEvent(Protocol.java:517)
      [JBoss] at org.jgroups.protocols.FC.receiveDownEvent(FC.java:314)
      [JBoss] at org.jgroups.stack.Protocol.passDown(Protocol.java:551)
      [JBoss] at org.jgroups.protocols.FRAG2.down(FRAG2.java:167)
      [JBoss] at org.jgroups.stack.Protocol.receiveDownEvent(Protocol.java:517)
      [JBoss] at org.jgroups.stack.Protocol.passDown(Protocol.java:551)
      [JBoss] at org.jgroups.protocols.pbcast.STATE_TRANSFER.down(STATE_TRANSFER.java:294)
      [JBoss] at org.jgroups.stack.Protocol.receiveDownEvent(Protocol.java:517)
      [JBoss] at org.jgroups.stack.ProtocolStack.down(ProtocolStack.java:385)
      [JBoss] at org.jgroups.JChannel.down(JChannel.java:1231)
      [JBoss] at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.down(MessageDispatcher.java:788)
      [JBoss] at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.passDown(MessageDispatcher.java:765)
      [JBoss] at org.jgroups.blocks.RequestCorrelator.sendRequest(RequestCorrelator.java:299)
      [JBoss] at org.jgroups.blocks.GroupRequest.doExecute(GroupRequest.java:444)
      [JBoss] at org.jgroups.blocks.GroupRequest.execute(GroupRequest.java:193)
      [JBoss] at org.jgroups.blocks.MessageDispatcher.castMessage(MessageDispatcher.java:429)

      Having a look at FC, in handleDownMessage(), where the problem occurred, there's this:

      Util.release(lock);
      try
      {
      ...
      for(int i=0; i < creditors.size(); i++)

      { sendCreditRequest((Address)creditors.get(i)); }

      }
      ....

      in handleCredit() there's:

      if(Util.acquire(lock)) {
      ...
      if(creditors.size() > 0)

      { // we are blocked because we expect credit from one or more members creditors.remove(sender); ... }

      ...
      }

      If the creditors.remove(sender) call is invoked while the handleDownMessage for loop is looping, there's a possibility of IndexOutOfBoundsException.

              rhn-engineering-bban Bela Ban
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: