Track tasks and feature requests
Join 40 million developers who use GitHub issues to help identify, assign, and keep track of the features and bug fixes your projects need.
Sign up for free See pricing for teams and enterprisesSingleConnectionFactory stops connection on every stop/close on connection proxy [SPR-14499] #19068
Comments
This comment has been minimized.
This comment has been minimized.
Juergen Hoeller commented Which code path leads to the actual closing of the underlying connection in your scenario? We mean to track local start/stop state but only really stop the underlying connection if all clients are in stop state. And we don't mean to close the underlying connection at all before the |
This comment has been minimized.
This comment has been minimized.
Piotr Klimczak commented Hi Juergen! Huge thanks for quick answer.
I can see then intention in the code, which you have mentioned in your previous comment: to close only if all "references" or "start" were followed by "stops". If that is true, then solution will be as simple as:
Hope that helps. Regards |
This comment has been minimized.
This comment has been minimized.
Piotr Klimczak commented I was provided with some time from my manager as it is important for him to get this solved before our next release, so will try get some more analysis. Cheers |
This comment has been minimized.
This comment has been minimized.
Juergen Hoeller commented I'll be spending some time on this ASAP as well since our 4.3.2 release is scheduled for Wednesday next week (July 27th). As for the connection closing that you're experiencing, I only really see that happening on actual |
This comment has been minimized.
This comment has been minimized.
Piotr Klimczak commented Indeed, sorry for misunderstanding. Please put this issue on hold for now, as in fact it might be ActiveMQ issue which is refusing to start stopped connection. Still doing analysis. |
This comment has been minimized.
This comment has been minimized.
Piotr Klimczak commented So finally found that it is ActiveMQ issue with they PooledConnection implementation, which doesn't allow to start a stopped connection. Sorry for confusion and thanks a lot for your time. |
This comment has been minimized.
This comment has been minimized.
Juergen Hoeller commented Alright, no worries. As for using Spring's |
Piotr Klimczak opened SPR-14499 and commented
1st of all thanks for really great job, the Spring community is doing.
Now, we just started migrating from spring 3.2.X to 4.3.1 and we found that our JMS connectivity floods logs with warnings:
Setup of JMS message listener invoker failed for destination 'X.Y.Z' - trying to recover. Cause: Connection closed
The problem was introduced by this issue: #15030 and this commit: 4927c90.
(by adding localStart, localStop methods)
The purpose of SingleConnectionFactory suppose to be sharing same connection between threads. How sharing the same connection suppose to work at all, if it can be closed any time by any thread?
As we are finding this incorrect, that is the reason why this issue was created.
In fact, current implementation makes SingleConnectionFactory completely unusable.
While it can pass unit tests in simple scenarios (it passes our tests too), it definitely fails in runtime, where we are using about 100 consumers to different destinations.
Affects: 4.1.9, 4.2.7, 4.3.1