Repository navigation
Commit a42b3cb
authored
Requeue at a fixed interval while the consumer group is not empty (#4828)
* Requeue at a fixed interval while the consumer group is not empty
Since #4785 the ConsumerGroup finalizer retries deleting a Kafka group
that still has members without limit. It returns an error, so the
controller requeues with the rate limiter, which doubles the delay from
5ms up to 1000s. A dispatcher stays in the group until its in-flight
delivery ends, which takes up to the 60s connect timeout when the
subscriber is gone. By then the finalizer has failed about 25 times and
its next retry is about 17 minutes away, so the owner (KafkaChannel,
Trigger, KafkaSource) stays until something else enqueues the key.
Return controller.NewRequeueAfter(5s) instead, as the channel, broker
and sink reconcilers do, so the finalizer retries within 5s of the group
becoming empty. The status still records the failure.
Seen in channel-reconciler-tests-sasl-ssl on #4825:
- 11:04:06-11:04:44 "The group is not empty", backoff 63ms..2.5s..
- 11:05:10 the dispatcher closed its consumer after a 60s connect timeout
to the deleted subscriber
- 11:06:04 the test cleanup gave up with the Channel still present
- 11:07:44 the finalizer was removed, when a new leader took the lease
* Leave a consumer group in Kafka when it keeps members for 5 minutes
The ConsumerGroup finalizer retries while the Kafka group still has
members. A dispatcher leaves within about a minute, but a member that
Knative does not control never does, for example another application
using the same group.id as a KafkaSource. The finalizer then never
finishes, and neither does the deletion of the KafkaSource, Trigger or
KafkaChannel, or of their namespace.
Count the attempts with an expiring counter, as the broker finalizer does
for an unreachable Kafka cluster. After 60 attempts 5s apart, about 5
minutes, leave the group in Kafka, as the finalizer did before #4785, and
log it.1 parent b77c152 commit a42b3cb
3 files changed
Lines changed: 58 additions & 14 deletions
File tree
- control-plane/pkg/reconciler/consumergroup
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
257 | 262 | | |
258 | 263 | | |
259 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
260 | 268 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
266 | 284 | | |
267 | | - | |
268 | 285 | | |
269 | 286 | | |
270 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
1881 | 1882 | | |
1882 | 1883 | | |
1883 | 1884 | | |
| 1885 | + | |
1884 | 1886 | | |
1885 | 1887 | | |
1886 | 1888 | | |
| |||
2041 | 2043 | | |
2042 | 2044 | | |
2043 | 2045 | | |
| 2046 | + | |
2044 | 2047 | | |
2045 | 2048 | | |
2046 | 2049 | | |
| |||
2578 | 2581 | | |
2579 | 2582 | | |
2580 | 2583 | | |
2581 | | - | |
| 2584 | + | |
2582 | 2585 | | |
2583 | 2586 | | |
2584 | 2587 | | |
| |||
2598 | 2601 | | |
2599 | 2602 | | |
2600 | 2603 | | |
2601 | | - | |
2602 | | - | |
2603 | | - | |
2604 | | - | |
2605 | | - | |
2606 | | - | |
2607 | | - | |
2608 | 2604 | | |
2609 | 2605 | | |
2610 | 2606 | | |
| |||
2626 | 2622 | | |
2627 | 2623 | | |
2628 | 2624 | | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
2629 | 2648 | | |
2630 | 2649 | | |
2631 | 2650 | | |
| |||
2662 | 2681 | | |
2663 | 2682 | | |
2664 | 2683 | | |
| 2684 | + | |
2665 | 2685 | | |
2666 | 2686 | | |
2667 | 2687 | | |
| |||
2670 | 2690 | | |
2671 | 2691 | | |
2672 | 2692 | | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
2673 | 2699 | | |
2674 | 2700 | | |
2675 | 2701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
0 commit comments