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

Add new flag DONT_BLOCK

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 5.3.5
    • None
    • None
    • False
    • None
    • False

      This flag tells the transport to rather discard a message than block. E.g. the TransferQueueBundler would use offer() rather than add() to add a message to its queue. When full, the message would be discarded, preventing the sender thread from blocking on add().

      This flag can be set e.g. in cases where an incoming thread needs to send a message but doesn't want to block the thread from the thread pool. In the stack trace below, STABLE.sendStabilityMessage() could tag the stability message as DONT_BLOCK, to avoid the blocking at ArrayBlockingQueue.put.

      "Connection.Receiver [192.168.40.90:7913 - 192.168.40.91:47979]-76,dataChannel_11SAS_CLUSTER,tb6cas3-datachannel_11" #2427 prio=5 os_prio=0 tid=0x00007f80a8191cf0 nid=0x1933bc waiting on condition [0x00007f7f0a712000]
         java.lang.Thread.State: WAITING (parking)
      	at sun.misc.Unsafe.park(Native Method)
      	- parking to wait for  <0x00007f8f79499e78> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
      	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
      	at java.util.concurrent.ArrayBlockingQueue.put(ArrayBlockingQueue.java:353)
      	at org.jgroups.protocols.TransferQueueBundler.send(TransferQueueBundler.java:101)
      	at org.jgroups.protocols.TP.send(TP.java:1620)
      	at org.jgroups.protocols.TP._send(TP.java:1353)
      	at org.jgroups.protocols.TP.down(TP.java:1262)
      	at org.jgroups.stack.Protocol.down(Protocol.java:287)
      	at org.jgroups.stack.Protocol.down(Protocol.java:287)
      	at org.jgroups.protocols.pbcast.NAKACK2.down(NAKACK2.java:567)
      	at org.jgroups.protocols.pbcast.STABLE.sendStabilityMessage(STABLE.java:698)
      	at org.jgroups.protocols.pbcast.STABLE.handleStableMessage(STABLE.java:561)
      	at org.jgroups.protocols.pbcast.STABLE.handleUpEvent(STABLE.java:264)
      	at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:257)
      	at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:595)
      	at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:254)
      	at org.jgroups.protocols.Discovery.up(Discovery.java:300)
      	at org.jgroups.protocols.TP.passMessageUp(TP.java:1404)
      	at org.jgroups.util.SubmitToThreadPool$SingleMessageHandler.run(SubmitToThreadPool.java:98)
      	at org.jgroups.util.DirectExecutor.execute(DirectExecutor.java:10)
      	at org.jgroups.protocols.TP.submitToThreadPool(TP.java:1536)
      	at org.jgroups.protocols.TP.submitToThreadPool(TP.java:1531)
      	at org.jgroups.util.SubmitToThreadPool.process(SubmitToThreadPool.java:34)
      	at org.jgroups.util.MaxOneThreadPerSender.process(MaxOneThreadPerSender.java:63)
      	at org.jgroups.protocols.TP.handleSingleMessage(TP.java:1508)
      	at org.jgroups.protocols.TP.receive(TP.java:1479)
      	at org.jgroups.blocks.cs.BaseServer.receive(BaseServer.java:182)
      	at org.jgroups.blocks.cs.TcpConnection$Receiver.run(TcpConnection.java:306)
      	at java.lang.Thread.run(Thread.java:750)
      

              rhn-engineering-bban Bela Ban
              rhn-engineering-bban Bela Ban
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: