Skip to content

DefaultJmsListenerContainer may hang in an endless loop in doShutdown #36506

@fml2

Description

@fml2

We have an application that uses JMS via the Spring driven infrastructure. We also have unit tests that load the Spring container and perform some JMS operations.

After all the tests have run, the unit test executor remains active because not all threads are finished. The contender is the DefaultMessageListenerContainer which issues the log-messages

Still waiting for shutdown of . . . message listener invokers (iteration N)

Our test calls the stop() method for the jmsListenerEndpointRegistry but then the execution stucks in its doShutdown() method. Somehow the field activeInvokerCount never gets the value of 0. I can say for sure that there are no more active message listeners at that time.

There are also many questions about how to stop a JmsContainer on stackoverflow.

To remedy this and prevent an endless loop, it would be helpful if one could specify the max. number of wait cycles when shutting down the container. An emergency stop so to say.

After that number of wait cycles have been executed, the shutdown method would exit the while loop no matter what.

Thank you.

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions