Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-3392

NarayanaLRAClient#enlistCompensator close client too early - response reading may fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.11.0.Final
    • 5.10.6.Final
    • LRA
    • None
    • Undefined

      Method NarayanaLRAClient#enlistCompensator uses the JAX-RS client to call the lra-coordinator to enlist compenstator. But the client is closed too early. The client needs to be closed after the response is processed. Otherwise it can lead to errors[1].

      [1]

      2020-11-13 20:27:35,524 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /failing-after-lra-listener/action: org.jboss.resteasy.spi.UnhandledException: javax.ws.rs.ProcessingException: org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 151; received: 0
              at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:356)
              at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:193)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:456)
              at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:229)
              at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:135)
              at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:356)
              at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:138)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:215)
              at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
              at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
              at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.wildfly.swarm.generated.FaviconErrorHandler.handleRequest(FaviconErrorHandler.java:61)
              at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:91)
              at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
              at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
              at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)
              at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
              at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
              at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)
              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376)
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
              at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
              at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1348)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: javax.ws.rs.ProcessingException: org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 151; received: 0
              at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:245)
              at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:88)
              at org.jboss.resteasy.specimpl.AbstractBuiltResponse.readEntity(AbstractBuiltResponse.java:262)
              at io.narayana.lra.client.NarayanaLRAClient.enlistCompensator(NarayanaLRAClient.java:680)
              at io.narayana.lra.client.NarayanaLRAClient.enlistCompensator(NarayanaLRAClient.java:642)
              at io.narayana.lra.client.NarayanaLRAClient.joinLRA(NarayanaLRAClient.java:333)
              at io.narayana.lra.client.NarayanaLRAClient$Proxy$_$$_WeldClientProxy.joinLRA(Unknown Source)
              at io.narayana.lra.filter.ServerLRAFilter.filter(ServerLRAFilter.java:319)
              at io.narayana.lra.filter.ServerLRAFilter$Proxy$_$$_WeldClientProxy.filter(Unknown Source)
              at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:306)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:372)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:344)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:317)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:440)
              ... 52 more
      Caused by: org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 151; received: 0
              at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:178)
              at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:135)
              at java.io.FilterInputStream.read(FilterInputStream.java:133)
              at org.jboss.resteasy.specimpl.AbstractBuiltResponse$InputStreamWrapper.read(AbstractBuiltResponse.java:580)
              at org.jboss.resteasy.plugins.providers.ProviderHelper.readString(ProviderHelper.java:68)
              at org.jboss.resteasy.plugins.providers.StringTextStar.readFrom(StringTextStar.java:42)
              at org.jboss.resteasy.plugins.providers.StringTextStar.readFrom(StringTextStar.java:24)
              at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:66)
              at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:56)
              at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:211)
              ... 65 more
      

              ochaloup@redhat.com Ondrej Chaloupka (Inactive)
              ochaloup@redhat.com Ondrej Chaloupka (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: