Skip to content

Commit 0452683

Browse files
garyrussellartembilan
authored andcommitted
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** (cherry picked from commit 52d8ce5)
1 parent baa6597 commit 0452683

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
@@ -1367,6 +1367,9 @@ public void shutdown(@Nullable Runnable callback) {
13671367
if (!isActive()) {
13681368
logger.debug("Shutdown ignored - container is not active already");
13691369
this.lifecycleMonitor.notifyAll();
1370+
if (callback != null) {
1371+
callback.run();
1372+
}
13701373
return;
13711374
}
13721375
this.active = false;

0 commit comments

Comments
 (0)