activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-1873) AMQ222068: STOMP heartbeat handler is not stopped after StompConnection.destroy()
Date Tue, 22 May 2018 22:42:00 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-1873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16484702#comment-16484702
] 

ASF subversion and git services commented on ARTEMIS-1873:
----------------------------------------------------------

Commit 8d64f741a17846e814e9795ab101572e4acbb9a7 in activemq-artemis's branch refs/heads/master
from [~jbertram]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=8d64f74 ]

ARTEMIS-1873 STOMP heartbeater left alive on cxn destroy


> AMQ222068: STOMP heartbeat handler is not stopped after StompConnection.destroy()
> ---------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-1873
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1873
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: STOMP
>    Affects Versions: 2.7.0
>            Reporter: Paweł Puterla
>            Assignee: Justin Bertram
>            Priority: Major
>
> StompConnection.java (it's in artemis-stomp-protocol) utilizes a {{VersionedStompFrameHandler}}
frame handler which in the case of STOMP 1.1 and 1.2 contains a heartbeat scheduler.
> This scheduler is stopped when {{StompConnection.fail()}} is called but not for {{StompConnection.destroy()}}.
 So in some cases you may get dangling heartbeat threads from destroyed connections. These
threads simply try to send heartbeats to dead clients resulting in following warnings:
>  
> {noformat}
> 2018-05-17 17:01:06,591 WARN  [org.apache.activemq.artemis.core.protocol.stomp] (Thread-22
(ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$3@6b9ec8e5))
AMQ222068: connection closed org.apache.activemq.artemis.core.protocol.stomp.StompConnection@5d5327f9{noformat}
>  
> In my opinion it's just a simple oversight. From what I see ARTEMIS-934 did only fix
the issue for {{StompConnection.fail()}}. But RemoteConnections (which is StompConnection)
can also be destroy()'ed.
> Here's example diff that may fix it:
> {noformat}
> diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
> index fbd010775..4c11108c3 100644
> --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
> +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
> @@ -335,9 +335,10 @@ public final class StompConnection implements RemotingConnection
{
>           if (destroyed) {
>              return;
>           }
> +
> +         destroyed = true;
>        }
> -      destroyed = true;
>        internalClose();
> @@ -351,6 +352,10 @@ public final class StompConnection implements RemotingConnection
{
>     }
>     private void internalClose() {
> +      if (frameHandler != null) {
> +         frameHandler.disconnect();
> +      }
> +
>        transportConnection.close();
>        manager.cleanup(this);
> @@ -372,9 +377,6 @@ public final class StompConnection implements RemotingConnection
{
>        ActiveMQServerLogger.LOGGER.connectionFailureDetected(me.getMessage(), me.getType());
> -      if (frameHandler != null) {
> -         frameHandler.disconnect();
> -      }
>        // Then call the listeners
>        callFailureListeners(me);
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message