Commit ccb8b80
authored
GH-1866: Fix Pause/Resume
Resolves #1866
The new retryable topic feature pauses/resumes individual partitions.
This broke normal container pause/resume by incorrectly resuming partitions
that were paused by the container pause operation.
Similarly, if individual partitions were paused and then the container was
paused and resumed, the container resumed all partitions.
Decouple the functionality to prevent this cross-talk.
Do not resume any individually paused partitions when the container is in a paused state.
Do not resume any individually paused partitions when the container is resumed.
Also
Use a `ConcurrentHashMap.newKeySet()` instead of synchronization on partition pause requests.
Use `getAssignedPartitions()` to allow the retry topic feature to work with manual assignments.
Add tests to verify no cross-talk between pausing individual partitions and the container.
* Fix race in test.1 parent e29ec92 commit ccb8b80
File tree
3 files changed
+84
-27
lines changed- spring-kafka/src
- main/java/org/springframework/kafka/listener
- test/java/org/springframework/kafka/listener
3 files changed
+84
-27
lines changedLines changed: 5 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | 162 | | |
165 | 163 | | |
166 | 164 | | |
| |||
263 | 261 | | |
264 | 262 | | |
265 | 263 | | |
266 | | - | |
267 | | - | |
268 | | - | |
| 264 | + | |
269 | 265 | | |
270 | 266 | | |
271 | 267 | | |
272 | 268 | | |
273 | | - | |
274 | | - | |
275 | | - | |
| 269 | + | |
276 | 270 | | |
277 | 271 | | |
278 | 272 | | |
279 | 273 | | |
280 | | - | |
281 | | - | |
282 | | - | |
| 274 | + | |
283 | 275 | | |
284 | 276 | | |
285 | 277 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1270 | 1270 | | |
1271 | 1271 | | |
1272 | 1272 | | |
1273 | | - | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
1274 | 1276 | | |
1275 | 1277 | | |
1276 | 1278 | | |
| |||
1522 | 1524 | | |
1523 | 1525 | | |
1524 | 1526 | | |
1525 | | - | |
| 1527 | + | |
| 1528 | + | |
1526 | 1529 | | |
1527 | 1530 | | |
1528 | 1531 | | |
| |||
1531 | 1534 | | |
1532 | 1535 | | |
1533 | 1536 | | |
1534 | | - | |
1535 | | - | |
| 1537 | + | |
1536 | 1538 | | |
1537 | 1539 | | |
1538 | 1540 | | |
| |||
Lines changed: 73 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
2553 | 2554 | | |
2554 | 2555 | | |
2555 | 2556 | | |
2556 | | - | |
2557 | | - | |
2558 | | - | |
2559 | | - | |
2560 | | - | |
2561 | | - | |
2562 | | - | |
2563 | | - | |
2564 | 2557 | | |
2565 | 2558 | | |
2566 | 2559 | | |
| |||
2569 | 2562 | | |
2570 | 2563 | | |
2571 | 2564 | | |
| 2565 | + | |
2572 | 2566 | | |
2573 | 2567 | | |
2574 | 2568 | | |
| 2569 | + | |
2575 | 2570 | | |
2576 | 2571 | | |
2577 | | - | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
2578 | 2585 | | |
2579 | 2586 | | |
2580 | 2587 | | |
| 2588 | + | |
2581 | 2589 | | |
2582 | | - | |
| 2590 | + | |
2583 | 2591 | | |
2584 | 2592 | | |
2585 | 2593 | | |
| |||
2671 | 2679 | | |
2672 | 2680 | | |
2673 | 2681 | | |
| 2682 | + | |
| 2683 | + | |
2674 | 2684 | | |
2675 | 2685 | | |
2676 | 2686 | | |
| |||
2680 | 2690 | | |
2681 | 2691 | | |
2682 | 2692 | | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
2683 | 2746 | | |
2684 | 2747 | | |
2685 | 2748 | | |
| |||
0 commit comments