Make leaderResignedChan buffered to protect against hang#1205
Make leaderResignedChan buffered to protect against hang#1205
leaderResignedChan buffered to protect against hang#1205Conversation
This one's aimed at fixing an intermittently failing tests that we're occasionally seeing in CI: https://github.com/riverqueue/river/actions/runs/24312334093/job/70984031771?pr=1203 It was possible for the test case to end to `leaderResignedChan` before `keepLeadershipLoop` entered its select, which with an unbuffered channel, could block forever. Changing this to a buffered channel lets `keepLeadershipLoop` consume the value as its leisure while making sure the send never blocks.
|
@codex review Admittedly, Claude did all the debugging work on this one. I figure we can cross-reference the proposed solution with Codex and make sure it's all above bar. |
|
Man, have hit three intermittently failing tests in a row now ... and they're all different lol. I'm not sure if we regressed recently on this front or what. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Actually, two of these are related to the leadership changes I made recently, so they are pretty new. |
This one's aimed at fixing an intermittently failing tests that we're
occasionally seeing in CI:
https://github.com/riverqueue/river/actions/runs/24312334093/job/70984031771?pr=1203
It was possible for the test case to end to
leaderResignedChanbeforekeepLeadershipLoopentered its select, which with an unbufferedchannel, could block forever. Changing this to a buffered channel lets
keepLeadershipLoopconsume the value as its leisure while making surethe send never blocks.