Repository navigation
Bound the CLIENT KILL loop in test_ask_retry_waits_for_reconnect - #758
Merged
Merged
Conversation
…SK test test_ask_retry_waits_for_reconnect ran CLIENT KILL TYPE normal on the importing node every 0.5 s for as long as memtier ran, and memtier reconnects 1 s after each drop (--reconnect-backoff-factor=1). The -ASK retries waiting for that node, and with them both clients' pipelines, completed only when a reconnect, its setup and the resends fit between two kills. The run time had no bound: 4-17 s locally under ASan+UBSan, and over the 60 s timeout on loaded CI runners (#680, again on PR #748 in "UBSan OSS-CLUSTER API: TCP Plaintext"). memtier itself does not hang: every slow run kept making progress, and with the killer bounded each run ends about 2 s after the last kill. Kill only connections opened after the test started the killer (memtier's, by CLIENT KILL ID), and stop after 5 rounds that dropped at least one. Assert that some were dropped. Keep memtier's stderr in a file and print its tail and the run time on failure or timeout, so a real hang would be visible instead of a bare TimeoutExpired. The test still guards #597: with redirect_target_conn() not accepting a connection waiting on its reconnect timer, it fails every run with 45-86 requests ending on -ASK. Fixes #680 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks for this. The root-cause write-up is convincing, and running the #597 revert as a mutant answers the obvious worry that bounding the killer would stop the test from guarding that bug. Keeping memtier's stderr when it times out is a good change on its own merits. Two small questions:
Apart from that, the test-only fix looks good to me. |
Collaborator
Author
|
Thanks. On the two points:
#756 adds shared |
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tests/test_cluster_ask_asking.py::test_ask_retry_waits_for_reconnectsometimes fails withsubprocess.TimeoutExpired(60 s) on sanitizer jobs (#680). It failed again on PR #748 at 316559b, in "UBSan OSS-CLUSTER API: TCP Plaintext" (job 117247837036). The log has only the traceback, because the test threw away memtier's stderr when it timed out. This is item 4 in #740.Root cause: the test, not memtier
CLIENT KILL TYPE normalon the importing node every 0.5 s for the whole memtier run.--reconnect-backoff-factor=1).--pipeline 8. They complete only when a reconnect, its setup (slot-map refresh, connect) and the resends all fit between two kills.memtier does not hang. To rule out a real hang I ran the old test under ASan+UBSan (
--enable-sanitizers --enable-ubsan), with 5 copies pinned to one CPU and 3 CPU burners on that same CPU:Fix (test only)
CLIENT KILL ID.KILL_WAVES = 5rounds that each dropped at least one memtier connection.There are no C++ changes, so this does not interact with #666 or #750. Neither of them touches this test.
Evidence (ASan+UBSan build of origin/master 63c0009, 3-shard oss-cluster)
-ASK|| sc->is_reconnect_pending()fromredirect_target_conn(), which reverts Cluster --retry-on-error: requests retried after -ASK are never sent with ASKING and bounce until --max-retries #597 / 3822415. The new test still fails on every run with it, so it still guards that bug.test_ask_retry_sends_askingstill passes.Affected versions
Test suite / CI only. The test was introduced by 3822415 (#600), which is not in any release tag (latest is 2.5.2). Release binaries are not affected.
Fixes #680
Refs #740
🤖 Generated with Claude Code
Note
Low Risk
Test-only changes to cluster ASK/reconnect coverage; no production or memtier binary behavior changes.
Overview
Stabilizes
test_ask_retry_waits_for_reconnectby capping connection drops and improving failure diagnostics when memtier runs under repeatedCLIENT KILLduring cluster-ASKretries.The killer no longer loops for the entire benchmark: it snapshots existing client IDs, then runs at most
KILL_WAVES(5) rounds that each kill at least one new connection viaCLIENT KILL ID(memtier only), instead ofCLIENT KILL TYPE normalfor the whole run. That bounds run time that previously depended on reconnect timing vs. a 0.5 s kill grid (#680). The test also asserts at least one connection was dropped so the scenario cannot pass as a no-op._runnow streams memtier stderr to a file, usesPopen/waitwith explicit timeout handling, and reports elapsed time plus stderr tail on failure so CI can distinguish stalls from hangs.Reviewed by Cursor Bugbot for commit 3a31c8a. Bugbot is set up for automated code reviews on this repo. Configure here.