[ 
https://issues.apache.org/jira/browse/ARTEMIS-4523?focusedWorklogId=893766&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-893766
 ]

ASF GitHub Bot logged work on ARTEMIS-4523:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Dec/23 13:52
            Start Date: 04/Dec/23 13:52
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #4700:
URL: https://github.com/apache/activemq-artemis/pull/4700#discussion_r1413902640


##########
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java:
##########
@@ -779,11 +782,18 @@ private void doFail(ActiveMQException me, String message) 
{
       }
       try {
          if (this.getConnectionInfo() != null) {
-            protocolManager.removeConnection(this.getConnectionInfo(), me);
+            
protocolManager.removeConnection(this.getConnectionInfo().getClientId(), this);
          }
-      } catch (InvalidClientIDException e) {
-         logger.warn("Couldn't close connection because invalid clientID", e);
       } finally {
+         try {
+            // doing the disconnect on the finally for extra caution.
+            // if removeConnection throws an exception of any kind, this 
should still happen
+            disconnect(false);
+         } catch (Throwable e) {
+            // it should never happen, but never say never
+            logger.warn("OpenWireConnection::disconnect failure", e);

Review Comment:
   I would prefer an actual log.warn on this case.
   an exception happening here means the disconnect will not happen here, and 
it could linger the consumer.
   
   I would rather have it on the logs than ignore with a log.debug.
   
   
   It "should" not happen, but if it does I would really like to have it logged.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 893766)
    Time Spent: 1.5h  (was: 1h 20m)

> Failover leaving consumers and producers behind
> -----------------------------------------------
>
>                 Key: ARTEMIS-4523
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4523
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.31.2
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.32.0
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Failover in OpenWire could leave consumers, producers and internal sessions 
> hanging behind.
> If the failover happened in a race condition where the new connection 
> (reconnection) happened before the client failure.. you could end with 
> consumers without connections.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to