[ 
https://issues.apache.org/jira/browse/ARTEMIS-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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)

Reply via email to