steingebein commented on a change in pull request #603: [CXF-8161] fix memory 
leak and thread leak in JMSDestination
URL: https://github.com/apache/cxf/pull/603#discussion_r349071898
 
 

 ##########
 File path: 
rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/PollingMessageListenerContainer.java
 ##########
 @@ -210,6 +210,8 @@ protected void handleException(Throwable e) {
             wrapped.addSuppressed(e);
         }
         this.exceptionListener.onException(wrapped);
+        // stop the executor and the current thread after handling of the 
exception.
 
 Review comment:
   Yes. I had two reasons for my solution:
   * If you call `stop()` before the Exception handling is finished, the poller 
thread will be shutdown and the Exception handling will be interrupted 
immediately. (`AbstractMessageListenerContainer#stop()` calls `shutdownNow()`)
   * `JMSDestination#restartConnection()` checks the running-Flag now, so we 
need to unset it before `ExceptionListener` calls `restartConnection()`
   
   If it's ok for you I change it to 
      ```
    @Override
       public void stop() {
           LOG.fine("Shutting down " + this.getClass().getSimpleName());
           running = false;
           super.stop();
       }
   ```
   and to `this.stop()` without comment in `handleException`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to