Repository navigation
keeper: change request queue push timeout - #121559
Conversation
`ZooKeeper::pushRequest` used `operation_timeout_ms` as the timeout for pushing into `requests_queue`. But a failed push is not a failed operation: the surrounding `catch` calls `finalize`, which tears down the whole session. Losing the session because the queue stayed full for one operation timeout is far too aggressive. Wait `3 * session_timeout_ms` instead. By the time that elapses the session is dead anyway, so nothing is lost by being patient. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [81aed47] Summary: ✅
AI ReviewSummaryThis PR changes Findings
Tests
Final VerdictStatus: Minimum required action: stop treating local queue-enqueue timeout as proof that the Keeper session is dead, then add a regression test that covers queue saturation without session loss. LLVM Coverage ReportMeasured on commit 81aed47.
Changed lines: Changed C/C++ lines covered: 6/9 (66.67%) · Uncovered code |
| /// A failed push kills the session (the `catch` below calls `finalize`), so be patient here. | ||
| const UInt64 push_timeout_ms = 3 * static_cast<UInt64>(args.session_timeout_ms); | ||
|
|
||
| if (!requests_queue.tryPush(std::move(info), push_timeout_ms)) |
There was a problem hiding this comment.
requests_queue saturation is still treated as a session failure here. A healthy session can keep making send/receive progress while producers outpace the single sender for longer than 3 * session_timeout_ms; when that happens tryPush times out, the catch below still calls finalize, and we tear down ephemeral nodes and watches even though the Keeper session is alive. If the goal is to stop queue backpressure from invalidating the session, this timeout needs to fail just the enqueuing request (for example by bypassing the finalize path for this ZOPERATIONTIMEOUT), not just wait longer before expiring the whole session.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 13 s compile time in total, 7 of them have a recent master baseline. |
Backport #121559 to 26.9: keeper: change request queue push timeout
Backport #121559 to 26.8: keeper: change request queue push timeout
Backport #121559 to 26.7: keeper: change request queue push timeout
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Do not drop the ClickHouse Keeper session when the client's outgoing request queue stays full for longer than
operation_timeout_ms. The enqueue wait is now three timessession_timeout_ms, so a short burst of backpressure no longer terminates the session and invalidates all its ephemeral nodes and watches.Workflow [PR]
Sync PR [sync-upstream/pr/121559]
Version info
26.10.1.512-master(included in26.10and later)26.9.2.22,26.8.11.25,26.7.14.41