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

Donald Kwakkel updated AMQ-6793:
--------------------------------
    Description: 
Sometimes I get following exception when shutting down:
{code}
2017-08-14 21:47:57,470 [ActiveMQ Transport Server Thread Handler: 
tcp://localhost:28007] INFO  org.apache.activemq.broker.TransportConnector - 
Could not accept connection during shutdown  : {}
java.lang.InterruptedException
        at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
        at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2088)
        at 
java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
        at 
org.apache.activemq.transport.tcp.TcpTransportServer$1.run(TcpTransportServer.java:479)
        at java.lang.Thread.run(Thread.java:748)
{code}
When I look at line 495 of 
http://activemq.apache.org/maven/apidocs/src-html/org/apache/activemq/transport/tcp/TcpTransportServer.html:
{code}
                        if (!isStopped() || !isStopping()) {
{code}
I wonder if it must not be an '&&' iso '||' like  line 478:
{code}
                        while (!isStopped() && !isStopping()) {
{code}
Or maybe the doStop must join the socketHandlerThread after 
this.socketHandlerThread.interrupt(); Because now doStop just continues, and 
ServiceSupport.stop method could call   this.stopping.set(false); while the 
interrupt is not yet processed in some cases by the socketHandlerThread.

  was:
Sometimes I get following error when shutting down:
{code}
2017-08-14 21:47:57,470 [ActiveMQ Transport Server Thread Handler: 
tcp://localhost:28007] INFO  org.apache.activemq.broker.TransportConnector - 
Could not accept connection during shutdown  : {}
java.lang.InterruptedException
        at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
        at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2088)
        at 
java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
        at 
org.apache.activemq.transport.tcp.TcpTransportServer$1.run(TcpTransportServer.java:479)
        at java.lang.Thread.run(Thread.java:748)
{code}
When I look at line 495 of 
http://activemq.apache.org/maven/apidocs/src-html/org/apache/activemq/transport/tcp/TcpTransportServer.html:
{code}
                        if (!isStopped() || !isStopping()) {
{code}
I wonder if it must not be an '&&' iso '||' like  line 478:
{code}
                        while (!isStopped() && !isStopping()) {
{code}
Or maybe the doStop must join the socketHandlerThread after 
this.socketHandlerThread.interrupt(); Because now doStop just continues, and 
ServiceSupport.stop method could call   this.stopping.set(false); while the 
interrupt is not yet processed in some cases by the socketHandlerThread.


> Could not accept connection during shutdown  : {} 
> java.lang.InterruptedException
> --------------------------------------------------------------------------------
>
>                 Key: AMQ-6793
>                 URL: https://issues.apache.org/jira/browse/AMQ-6793
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.15.0
>         Environment: Linux  4.10.0-32-generic #36-Ubuntu SMP Tue Aug 8 
> 12:10:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
> java version "1.8.0_131"
> Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
> Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
>            Reporter: Donald Kwakkel
>
> Sometimes I get following exception when shutting down:
> {code}
> 2017-08-14 21:47:57,470 [ActiveMQ Transport Server Thread Handler: 
> tcp://localhost:28007] INFO  org.apache.activemq.broker.TransportConnector - 
> Could not accept connection during shutdown  : {}
> java.lang.InterruptedException
>       at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
>       at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2088)
>       at 
> java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
>       at 
> org.apache.activemq.transport.tcp.TcpTransportServer$1.run(TcpTransportServer.java:479)
>       at java.lang.Thread.run(Thread.java:748)
> {code}
> When I look at line 495 of 
> http://activemq.apache.org/maven/apidocs/src-html/org/apache/activemq/transport/tcp/TcpTransportServer.html:
> {code}
>                         if (!isStopped() || !isStopping()) {
> {code}
> I wonder if it must not be an '&&' iso '||' like  line 478:
> {code}
>                         while (!isStopped() && !isStopping()) {
> {code}
> Or maybe the doStop must join the socketHandlerThread after 
> this.socketHandlerThread.interrupt(); Because now doStop just continues, and 
> ServiceSupport.stop method could call   this.stopping.set(false); while the 
> interrupt is not yet processed in some cases by the socketHandlerThread.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to