You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Jean-Baptiste Onofré (Jira)" <ji...@apache.org> on 2021/07/04 04:45:00 UTC

[jira] [Resolved] (AMQ-8304) org.apache.activemq.transport.tcp.TcpTransport.run() attempts to read from closed stream

     [ https://issues.apache.org/jira/browse/AMQ-8304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Onofré resolved AMQ-8304.
---------------------------------------
    Fix Version/s: 5.16.3
                   5.17.0
       Resolution: Fixed

> org.apache.activemq.transport.tcp.TcpTransport.run() attempts to read from closed stream
> ----------------------------------------------------------------------------------------
>
>                 Key: AMQ-8304
>                 URL: https://issues.apache.org/jira/browse/AMQ-8304
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.16.2
>            Reporter: Sekhar Durga
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 5.17.0, 5.16.3
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Our problem is as follows:
> We have an application which stops broker on its exit using org.apache.activemq.broker.BrokerService.stop() call.
> The above stop call stops TransportConnection(s), and in the middle of stopping, org.apache.activemq.transport.tcp.TcpTransport.run() is attempting to read from  closed stream, which is causing following exceptions in our application logs:
> ================
> connectionErrorOccurred called with null
> javax.jms.JMSException: java.io.EOFException
> at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:54)
> at org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1960)
> at org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:1979)
> at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:114)
> at org.apache.activemq.transport.ResponseCorrelator.onException(ResponseCorrelator.java:126)
> at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:114)
> at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:114)
> at org.apache.activemq.transport.WireFormatNegotiator.onException(WireFormatNegotiator.java:173)
> at org.apache.activemq.transport.AbstractInactivityMonitor.onException(AbstractInactivityMonitor.java:345)
> at org.apache.activemq.transport.TransportSupport.onException(TransportSupport.java:96)
> at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:219)
> at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.io.EOFException: null
> at java.base/java.io.DataInputStream.readInt(DataInputStream.java:397)
> at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
> at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:240)
> at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:232)
> at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)
> ================
>  
> It seems we need to check for !isStopping() as well at following location:
> [https://github.com/apache/activemq/blob/activemq-5.16.x/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java#L214]
> It seems, we have done the same at [https://github.com/apache/activemq/blob/activemq-5.16.x/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java#L330]
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)