Commit e1081de
committed
GH-2920: SMLC: Interrupt ML on shutdown
Fixes: #2920
When the `SimpleMessageListenerContainer.shutdownTimeout` period is over,
there is no reason to keep any related threads active, sometimes blocking
the whole application stop.
* Introduce a `List SimpleMessageListenerContainer.processorThreadsToInterrupt`
to keep track of the scheduled `AsyncMessageProcessingConsumer`.
* Interrupt those threads when `this.cancellationLock.await()` is not successful
in the `SimpleMessageListenerContainer.shutdownAndWaitOrCallback()`
**Auto-cherry-pick to `3.2.x`**1 parent 8baaa76 commit e1081de
File tree
2 files changed
+52
-2
lines changed- spring-rabbit/src
- main/java/org/springframework/amqp/rabbit/listener
- test/java/org/springframework/amqp/rabbit/listener
2 files changed
+52
-2
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
704 | 706 | | |
705 | 707 | | |
706 | 708 | | |
| 709 | + | |
707 | 710 | | |
708 | 711 | | |
709 | 712 | | |
| |||
1349 | 1352 | | |
1350 | 1353 | | |
1351 | 1354 | | |
| 1355 | + | |
1352 | 1356 | | |
1353 | 1357 | | |
1354 | 1358 | | |
| |||
1433 | 1437 | | |
1434 | 1438 | | |
1435 | 1439 | | |
| 1440 | + | |
1436 | 1441 | | |
1437 | 1442 | | |
1438 | 1443 | | |
| |||
Lines changed: 47 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
220 | | - | |
| 221 | + | |
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
275 | | - | |
| 276 | + | |
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
| |||
756 | 757 | | |
757 | 758 | | |
758 | 759 | | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
759 | 804 | | |
760 | 805 | | |
761 | 806 | | |
| |||
0 commit comments