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

[Broker-J] java.util.NoSuchElementException in AMQPConnection_1_0Impl.next()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: qpid-java-broker-7.0.1, qpid-java-broker-7.1.0, qpid-java-broker-7.0.4, qpid-java-broker-7.0.5, qpid-java-broker-7.0.6, qpid-java-broker-7.0.7, qpid-java-broker-8.0.0, qpid-java-broker-7.1.1, qpid-java-broker-7.1.2, qpid-java-broker-7.0.8, qpid-java-broker-7.1.3, qpid-java-broker-7.1.4, qpid-java-broker-7.0.9, qpid-java-broker-7.1.5, qpid-java-broker-7.1.6, qpid-java-broker-7.1.7, qpid-java-broker-7.1.8, qpid-java-broker-8.0.1, qpid-java-broker-7.1.9, qpid-java-broker-8.0.2, qpid-java-broker-7.1.10, qpid-java-broker-8.0.3, qpid-java-broker-7.1.11, qpid-java-broker-8.0.4, qpid-java-broker-7.1.12
    • Fix Version/s: qpid-java-broker-8.0.5
    • Component/s: Broker-J
    • Labels:
      None

      Description

      Issue discovered during log analysis after introducing a monitoring tool, which polls broker REST API for statistics on a regular basis:

      2021-02-26 13:12:13,834 INFO  [qtp1796793599-147] (q.m.a.allowed) - [mng:N/A(monit@/127.0.0.1:54330)] ACL-1001 : Allowed : Access Management
      2021-02-26 13:12:13,902 ERROR [qtp1796793599-147] (o.a.q.s.m.p.f.ExceptionHandlingFilter) - Unexpected exception in servlet '/api/latest/broker': 
      java.util.NoSuchElementException: null
              at org.apache.qpid.server.protocol.v1_0.AMQPConnection_1_0Impl$2.next(AMQPConnection_1_0Impl.java:1876)
              at org.apache.qpid.server.protocol.v1_0.AMQPConnection_1_0Impl$2.next(AMQPConnection_1_0Impl.java:1846)
              at org.apache.qpid.server.transport.AbstractAMQPConnection.getOldestTransactionStartTime(AbstractAMQPConnection.java:1108)
              at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.apache.qpid.server.model.ConfiguredObjectMethodAttributeOrStatistic.getValue(ConfiguredObjectMethodAttributeOrStatistic.java:68)
              at org.apache.qpid.server.model.ConfiguredObjectMethodStatistic.getValue(ConfiguredObjectMethodStatistic.java:26)
              at org.apache.qpid.server.model.AbstractConfiguredObject.getStatistics(AbstractConfiguredObject.java:3436)
              at org.apache.qpid.server.model.AbstractConfiguredObject.getStatistics(AbstractConfiguredObject.java:3423)
              at org.apache.qpid.server.management.plugin.servlet.rest.ConfiguredObjectToMapConverter.incorporateStatisticsIntoMap(ConfiguredObjectToMapConverter.java:218)
              at org.apache.qpid.server.management.plugin.servlet.rest.ConfiguredObjectToMapConverter.convertObjectToMap(ConfiguredObjectToMapConverter.java:65)
              at org.apache.qpid.server.management.plugin.servlet.rest.ConfiguredObjectToMapConverter.incorporateChildrenIntoMap(ConfiguredObjectToMapConverter.java:271)
              at org.apache.qpid.server.management.plugin.servlet.rest.ConfiguredObjectToMapConverter.convertObjectToMap(ConfiguredObjectToMapConverter.java:69)
              at org.apache.qpid.server.management.plugin.servlet.rest.ConfiguredObjectToMapConverter.incorporateChildrenIntoMap(ConfiguredObjectToMapConverter.java:271)
              at org.apache.qpid.server.management.plugin.servlet.rest.ConfiguredObjectToMapConverter.convertObjectToMap(ConfiguredObjectToMapConverter.java:69)
              at org.apache.qpid.server.management.plugin.controller.latest.LatestManagementController.convertObject(LatestManagementController.java:590)
              at org.apache.qpid.server.management.plugin.controller.latest.LatestManagementController.formatConfiguredObject(LatestManagementController.java:555)
              at org.apache.qpid.server.management.plugin.servlet.rest.RestServlet.sendResponse(RestServlet.java:263)
              at org.apache.qpid.server.management.plugin.servlet.rest.RestServlet.doGet(RestServlet.java:119)
              at org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet.doGet(AbstractServlet.java:128)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
              at org.apache.qpid.server.management.plugin.filter.AuthenticationCheckFilter$1.run(AuthenticationCheckFilter.java:161)
              at org.apache.qpid.server.management.plugin.filter.AuthenticationCheckFilter$1.run(AuthenticationCheckFilter.java:157)
              at java.security.AccessController.doPrivileged(Native Method)
              at javax.security.auth.Subject.doAs(Subject.java:422)
              at org.apache.qpid.server.management.plugin.filter.AuthenticationCheckFilter.doFilterChainAs(AuthenticationCheckFilter.java:156)
              at org.apache.qpid.server.management.plugin.filter.AuthenticationCheckFilter.doFilter(AuthenticationCheckFilter.java:126)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
              at org.apache.qpid.server.management.plugin.filter.LoggingFilter.doFilter(LoggingFilter.java:63)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
              at org.apache.qpid.server.management.plugin.filter.ForbiddingTraceFilter.doFilter(ForbiddingTraceFilter.java:65)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
              at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:310)
              at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:264)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
              at org.apache.qpid.server.management.plugin.filter.ExceptionHandlingFilter.doFilter(ExceptionHandlingFilter.java:59)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1607)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1577)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
              at org.eclipse.jetty.server.Server.handle(Server.java:500)
              at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
              at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
              at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
              at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
              at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
              at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
              at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
              at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
              at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
              at org.apache.qpid.server.bytebuffer.QpidByteBufferFactory.lambda$null$0(QpidByteBufferFactory.java:464)
              at java.lang.Thread.run(Thread.java:748)
      

      Seems to be concurrency issue: AMQPConnection_1_0Impl creates an iterator for ServerTransaction instances and between calls iterator.hasNext() and iterator.next() opened transactions were removed, which lead to NoSuchElementException.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              daniel.kirilyuk Daniil Kirilyuk
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: