Uploaded image for project: 'Qpid JMS'
  1. Qpid JMS
  2. QPIDJMS-337

Consumer created on non-started connection can acquire messages from the broker due to unexpectedly given credits

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: qpid-jms-client
    • Labels:
      None

      Description

      Flow command with credits is issued for the consumer link created on non-started connection. As result, such consumer can prematurely acquire messages from the broker.
      For the code below

      Connection connection = factory.createConnection(username, password);
      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
      //connection.stop();
      MessageConsumer messageConsumer = session.createConsumer(queue);
      connection.close();
      

      the following frame stack traces are logged

      [1955726848:0] -> Open{ containerId='ID:cf0ea7b4-3b60-425d-a79b-8bc5ab0978eb:1', hostname='localhost', maxFrameSize=1048576, channelMax=32767, idleTimeOut=30000, outgoingLocales=null, incomingLocales=null, offeredCapabilities=null, desiredCapabilities=[sole-connection-for-container, DELAYED_DELIVERY, ANONYMOUS-RELAY, SHARED-SUBS], properties={product=QpidJMS, version=0.27.0-SNAPSHOT, platform=JVM: 1.8.0_121, 25.121-b13, Oracle Corporation, OS: Linux, 4.12.13-200.fc25.x86_64, amd64}}
      [1955726848:0] <- Open{ containerId='1ba5f492-a39a-46f7-9906-58c4ec826802', hostname='null', maxFrameSize=262144, channelMax=255, idleTimeOut=0, outgoingLocales=null, incomingLocales=null, offeredCapabilities=[ANONYMOUS-RELAY, SHARED-SUBS, sole-connection-for-container], desiredCapabilities=null, properties={product=qpid, version=7.0.0-SNAPSHOT, qpid.build=332a3c08c14705ebab2853ab2e58f2f64a24f409, qpid.instance_name=Broker, sole-connection-detection-policy=0}}
      [1955726848:0] -> Begin{remoteChannel=null, nextOutgoingId=1, incomingWindow=2047, outgoingWindow=2147483647, handleMax=65535, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [1955726848:0] <- Begin{remoteChannel=0, nextOutgoingId=0, incomingWindow=8192, outgoingWindow=2048, handleMax=4294967295, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [1955726848:1] -> Begin{remoteChannel=null, nextOutgoingId=1, incomingWindow=2047, outgoingWindow=2147483647, handleMax=65535, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [1955726848:1] <- Begin{remoteChannel=1, nextOutgoingId=0, incomingWindow=8192, outgoingWindow=2048, handleMax=4294967295, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [1955726848:1] -> Attach{name='qpid-jms:receiver:ID:9986ade6-6501-45f3-b22c-aa2785bf98c7:1:1:1:queue', handle=0, role=RECEIVER, sndSettleMode=UNSETTLED, rcvSettleMode=FIRST, source=Source{address='queue', durable=NONE, expiryPolicy=LINK_DETACH, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=Modified{deliveryFailed=true, undeliverableHere=null, messageAnnotations=null}, outcomes=[amqp:accepted:list, amqp:rejected:list, amqp:released:list, amqp:modified:list], capabilities=[queue]}, target=Target{address='null', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}, unsettled=null, incompleteUnsettled=false, initialDeliveryCount=null, maxMessageSize=null, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [1955726848:1] <- Attach{name='qpid-jms:receiver:ID:9986ade6-6501-45f3-b22c-aa2785bf98c7:1:1:1:queue', handle=0, role=SENDER, sndSettleMode=UNSETTLED, rcvSettleMode=FIRST, source=Source{address='queue', durable=NONE, expiryPolicy=LINK_DETACH, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=Modified{deliveryFailed=true, undeliverableHere=null, messageAnnotations=null}, outcomes=[amqp:accepted:list, amqp:released:list, amqp:rejected:list], capabilities=[queue]}, target=Target{address='null', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}, unsettled={}, incompleteUnsettled=false, initialDeliveryCount=0, maxMessageSize=null, offeredCapabilities=[SHARED-SUBS], desiredCapabilities=null, properties={}}
      [1955726848:1] -> Flow{nextIncomingId=0, incomingWindow=2047, nextOutgoingId=1, outgoingWindow=2147483647, handle=0, deliveryCount=0, linkCredit=1000, available=null, drain=false, echo=false, properties=null}
      [1955726848:0] -> Close{error=null}
      [1955726848:0] <- Close{error=null}
      

      Stopping connection explicitly before consumer creation has no effect.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              orudyy Alex Rudyy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: