reta 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_r348877996
##########
File path:
rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
##########
@@ -174,9 +174,9 @@ public void onException(JMSException exception) {
}
}
- protected void restartConnection() {
+ protected synchronized void restartConnection() {
Review comment:
To be fair, I am not sure this is the right thing. Just looking over the
code, I think we could run into the deadlock pretty easy. For example,
`JMSDestination::activate()` executes `restartConnection()` in `unnamed`
thread, whereas the `ExceptionListener` will be executed in the context of
`PollingMessageListenerContainer` thread pool. If the the exception happens in
one of the pollers while the `restartConnection()` is still in progress (I
think it is very possible), we would have an issue.
----------------------------------------------------------------
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