Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-7769

[AMQP 0-8..0-91] Support decoding of type codes u (unsigned short) and B (unsigned byte) to maximise compatibility with other AMQP implementations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • qpid-java-broker-7.0.0
    • Broker-J
    • None

    Description

      Currently the Broker fails on some paths if it tries to decode message headers using type codes u (unsigned short) and B (unsigned byte). It should understand these too.

      Flow to disk path fails like so:

      2017-05-02 20:21:34,515 ERROR [IO-/127.0.0.1:35664] (o.a.q.s.Main) - Uncaught exception, shutting down.
      java.lang.IllegalArgumentException: no such type code: 42
              at org.apache.qpid.server.protocol.v0_8.AMQTypeMap.getType(AMQTypeMap.java:47)
              at org.apache.qpid.server.protocol.v0_8.AMQTypedValue.readFromBuffer(AMQTypedValue.java:201)
              at org.apache.qpid.server.protocol.v0_8.FieldTable.setFromBuffer(FieldTable.java:1163)
              at org.apache.qpid.server.protocol.v0_8.FieldTable.populateFromBuffer(FieldTable.java:128)
              at org.apache.qpid.server.protocol.v0_8.FieldTable.clearEncodedForm(FieldTable.java:933)
              at org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties.clearEncodedForm(BasicContentHeaderProperties.java:959)
              at org.apache.qpid.server.protocol.v0_8.transport.ContentHeaderBody.clearEncodedForm(ContentHeaderBody.java:195)
              at org.apache.qpid.server.protocol.v0_8.MessageMetaData.clearEncodedForm(MessageMetaData.java:140)
              at org.apache.qpid.server.store.berkeleydb.AbstractBDBMessageStore$MessageDataSoftRef.clear(AbstractBDBMessageStore.java:986)
              at org.apache.qpid.server.store.berkeleydb.AbstractBDBMessageStore$StoredBDBMessage.flowToDisk(AbstractBDBMessageStore.java:1263)
              at org.apache.qpid.server.queue.AbstractQueue$FlowToDiskChecker.flowToDiskIfNecessary(AbstractQueue.java:3342)
              at org.apache.qpid.server.queue.AbstractQueue$FlowToDiskChecker.flowToDiskAndReportIfNecessary(AbstractQueue.java:3350)
              at org.apache.qpid.server.queue.AbstractQueue.enqueue(AbstractQueue.java:1105)
              at org.apache.qpid.server.message.RoutingResult$1.postCommit(RoutingResult.java:136)
              at org.apache.qpid.server.txn.LocalTransaction$4.postCommit(LocalTransaction.java:304)
              at org.apache.qpid.server.txn.LocalTransaction.doPostTransactionActions(LocalTransaction.java:433)
              at org.apache.qpid.server.txn.LocalTransaction.commitAsync(LocalTransaction.java:417)
              at org.apache.qpid.server.protocol.v0_8.AMQChannel.commit(AMQChannel.java:1132)
              at org.apache.qpid.server.protocol.v0_8.AMQChannel.receiveTxCommit(AMQChannel.java:3407)
              at org.apache.qpid.server.protocol.v0_8.ServerDecoder.processMethod(ServerDecoder.java:229)
              at org.apache.qpid.server.protocol.v0_8.AMQDecoder.processFrame(AMQDecoder.java:203)
              at org.apache.qpid.server.protocol.v0_8.BrokerDecoder.doProcessFrame(BrokerDecoder.java:141)
              at org.apache.qpid.server.protocol.v0_8.BrokerDecoder.processFrame(BrokerDecoder.java:65)
              at org.apache.qpid.server.protocol.v0_8.AMQDecoder.processInput(AMQDecoder.java:185)
              at org.apache.qpid.server.protocol.v0_8.BrokerDecoder$1.run(BrokerDecoder.java:104)
              at org.apache.qpid.server.protocol.v0_8.BrokerDecoder$1.run(BrokerDecoder.java:97)
              at java.security.AccessController.doPrivileged(Native Method)
              at org.apache.qpid.server.protocol.v0_8.BrokerDecoder.processAMQPFrames(BrokerDecoder.java:96)
              at org.apache.qpid.server.protocol.v0_8.AMQDecoder.decode(AMQDecoder.java:118)
              at org.apache.qpid.server.protocol.v0_8.ServerDecoder.decodeBuffer(ServerDecoder.java:44)
              at org.apache.qpid.server.protocol.v0_8.AMQPConnection_0_8Impl$1.run(AMQPConnection_0_8Impl.java:247)
              at org.apache.qpid.server.protocol.v0_8.AMQPConnection_0_8Impl$1.run(AMQPConnection_0_8Impl.java:239)
              at java.security.AccessController.doPrivileged(Native Method)
              at org.apache.qpid.server.protocol.v0_8.AMQPConnection_0_8Impl.received(AMQPConnection_0_8Impl.java:238)
              at org.apache.qpid.server.transport.MultiVersionProtocolEngine.received(MultiVersionProtocolEngine.java:130)
              at org.apache.qpid.server.transport.NonBlockingConnection.processAmqpData(NonBlockingConnection.java:593)
              at org.apache.qpid.server.transport.NonBlockingConnectionPlainDelegate.processData(NonBlockingConnectionPlainDelegate.java:58)
              at org.apache.qpid.server.transport.NonBlockingConnection.doRead(NonBlockingConnection.java:483)
              at org.apache.qpid.server.transport.NonBlockingConnection.doWork(NonBlockingConnection.java:270)
              at org.apache.qpid.server.transport.NetworkConnectionScheduler.processConnection(NetworkConnectionScheduler.java:124)
              at org.apache.qpid.server.transport.SelectorThread$ConnectionProcessor.processConnection(SelectorThread.java:563)
              at org.apache.qpid.server.transport.SelectorThread$SelectionTask.performSelect(SelectorThread.java:354)
              at org.apache.qpid.server.transport.SelectorThread$SelectionTask.run(SelectorThread.java:97)
              at org.apache.qpid.server.transport.SelectorThread.run(SelectorThread.java:521)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      

      If a consumer is using a different protocol (i.e. 0-10 and 1.0), the attempt to convert the message headers fails and this cause the Broker to crash. If a consumer is using a selector, the message headers need to be decoded to evaluate the header. This too causes the Broker to crash.

      If the message is observed from Management (AMQP or HTTP), the exception is caught and an error returned to the caller. The Broker does not crash. However, internally the FieldTable object's 'map' backing view is left in an incomplete state and a QBB slice is left undisposed. Any properties that followed the property with the unknown type in the encoded form will be absent from the backing map. This will mean that any future observation made by Management will apparently succeed but give incomplete results. Furthermore once the Management observation is made, the message could be delivered to a 0-10/1.0 consuming client but with incomplete headers.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kwall Keith Wall
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: