Commit 7d050fc
committed
kgo: do not cancel FindCoordinator if the parent context cancels
Some load testing in Redpanda showed a failure where consuming quit
unexpectedly and unrecoverably.
The sequence of events is:
* if OffsetCommit is issued just before Heartbeat
* and the group needs to be loaded so FindCoordinator is triggered,
* and OffsetCommit happens again, canceling the prior commit's context
Then,
* FindCoordinator would cancel
* Heartbeat, which is waiting on the same load, would fail with
context.Canceled
* This error is seen as a group leave error
* The group management logic would quit entirely.
Now, the context used for FindCoordinator is the client context, which
is only closed on client close. This is also better anyway -- if two
requests are waiting for the same coordinator load, we don't want the
first request canceling to error the second request. If all requests
cancel and we have a stray FindCoordinator in flight, that's ok too,
because well, worst case we'll just eventually have a little bit of
extra data cached that is likely needed in the future anyway.
Closes redpanda-data/redpanda#151311 parent b8b065d commit 7d050fc
1 file changed
+42
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1505 | 1505 | | |
1506 | 1506 | | |
1507 | 1507 | | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1508 | 1533 | | |
1509 | 1534 | | |
1510 | 1535 | | |
| |||
1575 | 1600 | | |
1576 | 1601 | | |
1577 | 1602 | | |
1578 | | - | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
1579 | 1609 | | |
1580 | 1610 | | |
1581 | 1611 | | |
| |||
1674 | 1704 | | |
1675 | 1705 | | |
1676 | 1706 | | |
1677 | | - | |
1678 | | - | |
1679 | | - | |
1680 | | - | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
1681 | 1718 | | |
1682 | 1719 | | |
1683 | 1720 | | |
| |||
0 commit comments