[jira] [Commented] (ARTEMIS-1727) Broker should close socket on failed connection attempt using OpenWire
[ https://issues.apache.org/jira/browse/ARTEMIS-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16386223#comment-16386223 ] ASF subversion and git services commented on ARTEMIS-1727: -- Commit 29250466ae3b29ea87e61dc637149fe1fb7f82eb in activemq-artemis's branch refs/heads/master from [~cshannon] [ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=2925046 ] ARTEMIS-1727 - Make sure transport is stopped on failed OpenWire connection To prevent a socket from hanging open by a bad client the broker should make sure to stop the transport if a connection attempt fails by an OpenWire client > Broker should close socket on failed connection attempt using OpenWire > -- > > Key: ARTEMIS-1727 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1727 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: OpenWire >Affects Versions: 2.4.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Major > Fix For: 2.5.0 > > > This is related to a patch I did for 5.x : AMQ-6561 > The OpenWire client will only close a connection failed connection attempt > automatically on a security error but not other JMSExceptions such as Invalid > client ids. Because of this it's possible a misbehaving client can leave > open sockets that won't be closed. The broker should detect a failed open > wire connection attempt and make sure the socket is killed. > Note that the CORE client does not seem to have this problem because it does > properly handle all JMS exceptions on initial connect/authorization and close > itself. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1727) Broker should close socket on failed connection attempt using OpenWire
[ https://issues.apache.org/jira/browse/ARTEMIS-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16386224#comment-16386224 ] ASF GitHub Bot commented on ARTEMIS-1727: - Github user asfgit closed the pull request at: https://github.com/apache/activemq-artemis/pull/1925 > Broker should close socket on failed connection attempt using OpenWire > -- > > Key: ARTEMIS-1727 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1727 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: OpenWire >Affects Versions: 2.4.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Major > Fix For: 2.5.0 > > > This is related to a patch I did for 5.x : AMQ-6561 > The OpenWire client will only close a connection failed connection attempt > automatically on a security error but not other JMSExceptions such as Invalid > client ids. Because of this it's possible a misbehaving client can leave > open sockets that won't be closed. The broker should detect a failed open > wire connection attempt and make sure the socket is killed. > Note that the CORE client does not seem to have this problem because it does > properly handle all JMS exceptions on initial connect/authorization and close > itself. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1727) Broker should close socket on failed connection attempt using OpenWire
[ https://issues.apache.org/jira/browse/ARTEMIS-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16386025#comment-16386025 ] ASF GitHub Bot commented on ARTEMIS-1727: - Github user cshannon commented on the issue: https://github.com/apache/activemq-artemis/pull/1925 @tabish121 - PR has been updated to use the broker's scheduled pool > Broker should close socket on failed connection attempt using OpenWire > -- > > Key: ARTEMIS-1727 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1727 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: OpenWire >Affects Versions: 2.4.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Major > Fix For: 2.5.0 > > > This is related to a patch I did for 5.x : AMQ-6561 > The OpenWire client will only close a connection failed connection attempt > automatically on a security error but not other JMSExceptions such as Invalid > client ids. Because of this it's possible a misbehaving client can leave > open sockets that won't be closed. The broker should detect a failed open > wire connection attempt and make sure the socket is killed. > Note that the CORE client does not seem to have this problem because it does > properly handle all JMS exceptions on initial connect/authorization and close > itself. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1727) Broker should close socket on failed connection attempt using OpenWire
[ https://issues.apache.org/jira/browse/ARTEMIS-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16383937#comment-16383937 ] ASF GitHub Bot commented on ARTEMIS-1727: - Github user cshannon commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/1925#discussion_r171924792 --- Diff: artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java --- @@ -641,13 +647,37 @@ public void fail(ActiveMQException me, String message) { } } try { - protocolManager.removeConnection(this.getConnectionInfo(), me); + if (this.getConnectionInfo() != null) { +protocolManager.removeConnection(this.getConnectionInfo(), me); + } } catch (InvalidClientIDException e) { ActiveMQServerLogger.LOGGER.warn("Couldn't close connection because invalid clientID", e); } shutdown(true); } + private void delayedStop(final int waitTime, final String reason, Throwable cause) { + if (waitTime > 0) { + try { +server.getExecutorFactory().getExecutor().execute(new Runnable() { + @Override + public void run() { + try { + Thread.sleep(waitTime); --- End diff -- I won't have time today but I will fix my patch and push it up first thing monday morning. > Broker should close socket on failed connection attempt using OpenWire > -- > > Key: ARTEMIS-1727 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1727 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: OpenWire >Affects Versions: 2.4.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Major > Fix For: 2.5.0 > > > This is related to a patch I did for 5.x : AMQ-6561 > The OpenWire client will only close a connection failed connection attempt > automatically on a security error but not other JMSExceptions such as Invalid > client ids. Because of this it's possible a misbehaving client can leave > open sockets that won't be closed. The broker should detect a failed open > wire connection attempt and make sure the socket is killed. > Note that the CORE client does not seem to have this problem because it does > properly handle all JMS exceptions on initial connect/authorization and close > itself. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1727) Broker should close socket on failed connection attempt using OpenWire
[ https://issues.apache.org/jira/browse/ARTEMIS-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16383907#comment-16383907 ] ASF GitHub Bot commented on ARTEMIS-1727: - Github user cshannon commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/1925#discussion_r171921837 --- Diff: artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java --- @@ -641,13 +647,37 @@ public void fail(ActiveMQException me, String message) { } } try { - protocolManager.removeConnection(this.getConnectionInfo(), me); + if (this.getConnectionInfo() != null) { +protocolManager.removeConnection(this.getConnectionInfo(), me); + } } catch (InvalidClientIDException e) { ActiveMQServerLogger.LOGGER.warn("Couldn't close connection because invalid clientID", e); } shutdown(true); } + private void delayedStop(final int waitTime, final String reason, Throwable cause) { + if (waitTime > 0) { + try { +server.getExecutorFactory().getExecutor().execute(new Runnable() { + @Override + public void run() { + try { + Thread.sleep(waitTime); --- End diff -- Agreed, I will make that change and use a scheduled executor instead. > Broker should close socket on failed connection attempt using OpenWire > -- > > Key: ARTEMIS-1727 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1727 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: OpenWire >Affects Versions: 2.4.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Major > Fix For: 2.5.0 > > > This is related to a patch I did for 5.x : AMQ-6561 > The OpenWire client will only close a connection failed connection attempt > automatically on a security error but not other JMSExceptions such as Invalid > client ids. Because of this it's possible a misbehaving client can leave > open sockets that won't be closed. The broker should detect a failed open > wire connection attempt and make sure the socket is killed. > Note that the CORE client does not seem to have this problem because it does > properly handle all JMS exceptions on initial connect/authorization and close > itself. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1727) Broker should close socket on failed connection attempt using OpenWire
[ https://issues.apache.org/jira/browse/ARTEMIS-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16383895#comment-16383895 ] ASF GitHub Bot commented on ARTEMIS-1727: - Github user tabish121 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/1925#discussion_r171918979 --- Diff: artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java --- @@ -641,13 +647,37 @@ public void fail(ActiveMQException me, String message) { } } try { - protocolManager.removeConnection(this.getConnectionInfo(), me); + if (this.getConnectionInfo() != null) { +protocolManager.removeConnection(this.getConnectionInfo(), me); + } } catch (InvalidClientIDException e) { ActiveMQServerLogger.LOGGER.warn("Couldn't close connection because invalid clientID", e); } shutdown(true); } + private void delayedStop(final int waitTime, final String reason, Throwable cause) { + if (waitTime > 0) { + try { +server.getExecutorFactory().getExecutor().execute(new Runnable() { + @Override + public void run() { + try { + Thread.sleep(waitTime); --- End diff -- Sleeping here seems like it might have a ripple on the other resources using the executor, maybe use a scheduled executor from the pool in ActiveMQServer ? > Broker should close socket on failed connection attempt using OpenWire > -- > > Key: ARTEMIS-1727 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1727 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: OpenWire >Affects Versions: 2.4.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Major > Fix For: 2.5.0 > > > This is related to a patch I did for 5.x : AMQ-6561 > The OpenWire client will only close a connection failed connection attempt > automatically on a security error but not other JMSExceptions such as Invalid > client ids. Because of this it's possible a misbehaving client can leave > open sockets that won't be closed. The broker should detect a failed open > wire connection attempt and make sure the socket is killed. > Note that the CORE client does not seem to have this problem because it does > properly handle all JMS exceptions on initial connect/authorization and close > itself. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1727) Broker should close socket on failed connection attempt using OpenWire
[ https://issues.apache.org/jira/browse/ARTEMIS-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16383789#comment-16383789 ] ASF GitHub Bot commented on ARTEMIS-1727: - GitHub user cshannon opened a pull request: https://github.com/apache/activemq-artemis/pull/1925 ARTEMIS-1727 - Make sure transport is stopped on failed OpenWire connection To prevent a socket from hanging open by a bad client the broker should make sure to stop the transport if a connection attempt fails by an OpenWire client You can merge this pull request into a Git repository by running: $ git pull https://github.com/cshannon/activemq-artemis ARTEMIS-1727 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/activemq-artemis/pull/1925.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1925 commit 8de2fccc883aa3a532e540e5e700e2c668e4e289 Author: Christopher L. Shannon (cshannon)Date: 2018-03-02T16:38:07Z ARTEMIS-1727 - Make sure transport is stopped on failed OpenWire connection To prevent a socket from hanging open by a bad client the broker should make sure to stop the transport if a connection attempt fails by an OpenWire client > Broker should close socket on failed connection attempt using OpenWire > -- > > Key: ARTEMIS-1727 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1727 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: OpenWire >Affects Versions: 2.4.0 >Reporter: Christopher L. Shannon >Assignee: Christopher L. Shannon >Priority: Major > Fix For: 2.5.0 > > > This is related to a patch I did for 5.x : AMQ-6561 > The OpenWire client will only close a connection failed connection attempt > automatically on a security error but not other JMSExceptions such as Invalid > client ids. Because of this it's possible a misbehaving client can leave > open sockets that won't be closed. The broker should detect a failed open > wire connection attempt and make sure the socket is killed. > Note that the CORE client does not seem to have this problem because it does > properly handle all JMS exceptions on initial connect/authorization and close > itself. -- This message was sent by Atlassian JIRA (v7.6.3#76005)