Skip to content

Commit 52d8ce5

Browse files
authored
GH-2511: Fix Container Stop Regression
Resolves #2511 When inactive containers are present, the `DefaultLifecycleProcessor` hangs for (default) 30 seconds waiting for containers to stop. When `stop(Runnable)` is called, the callback was not run if the container was not running; this was a regression caused by 1fdfe65. **cherry-pick to 2.4.x**
1 parent 5dd01b7 commit 52d8ce5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/AbstractMessageListenerContainer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,9 @@ public void shutdown(@Nullable Runnable callback) {
12931293
if (!isActive()) {
12941294
logger.debug("Shutdown ignored - container is not active already");
12951295
this.lifecycleMonitor.notifyAll();
1296+
if (callback != null) {
1297+
callback.run();
1298+
}
12961299
return;
12971300
}
12981301
this.active = false;

0 commit comments

Comments
 (0)