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

NPE upon connection failure during transacted session setup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.45.0
    • 0.46.0
    • qpid-jms-client
    • None

    Description

      Hi,

      I am using qpid-cms-client version 0.39.0, but I can see that the same problem exists in the current version.

      The function `JmsLocalTransactionContext.onConnectionInterrupted is missing a null-check for the `transactionInfo` field.

      This function is called from `JmsSession.onConnectionInterrupted`. If `transactionInfo` is null, this leads to the fact that consumers and producers are not properly notified of the interrupted connection.

      I am using qpid-jms-client in conjunction with Spring's `SingleConnectionFactory`. I can see rare cases where `transactionInfo` is null and in which the SpringConnectionFactory will not be informed about the transaction loss. In these cases, there is no automatic reconnect from Spring.

       

      Below some logging when the NPE occurs:

       

       

      2019-09-19T08:39:17,141 [WARN ] [AmqpProvider :(2):[amqps://10.0.0.12:5672]] AbstractEventExecutor - A task raised an exception. Task: org.apache.qpid.jms.provider.amqp.AmqpProvider$$Lambda$327/2054861790@467bfdd
      java.lang.NullPointerException: null
              at org.apache.qpid.jms.JmsLocalTransactionContext.onConnectionInterrupted(JmsLocalTransactionContext.java:333) ~[qpid-jms-client-0.39.0.jar!/:?]
              at org.apache.qpid.jms.JmsSession.onConnectionInterrupted(JmsSession.java:1340) ~[qpid-jms-client-0.39.0.jar!/:?]
              at org.apache.qpid.jms.JmsConnection.onConnectionFailure(JmsConnection.java:1356) ~[qpid-jms-client-0.39.0.jar!/:?]
              at org.apache.qpid.jms.provider.amqp.AmqpProvider.fireProviderException(AmqpProvider.java:1069) ~[qpid-jms-client-0.39.0.jar!/:?]
              at org.apache.qpid.jms.provider.amqp.AmqpProvider.lambda$onTransportClosed$18(AmqpProvider.java:867) ~[qpid-jms-client-0.39.0.jar!/:?]
              at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-common-4.1.29.Final.jar!/:4.1.29.Final]
              at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[netty-common-4.1.29.Final.jar!/:4.1.29.Final]
              at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:315) ~[netty-transport-native-epoll-4.1.29.Final-linux-x86_64.jar!/:4.1.29.Final]
              at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) ~[netty-common-4.1.29.Final.jar!/:4.1.29.Final]
              at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
      

       

      My suspicion is that this NPE is responsible for the exception not properly proparagated, but I am still investigating.

      It would help very much if anyone from the Qpid team could validate this as well.

       

      Thanks

      Attachments

        Activity

          People

            robbie Robbie Gemmell
            marioschlipf Mario Schlipf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: