Repository navigation
Reconnect when AUTH/SELECT/HELLO fails on a reconnect instead of hanging - #630
Conversation
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks for this. I went through the diff and the surrounding
The core fix looks solid to me. I'd mainly like the (would file this as a comment, not a formal block) |
|
Thanks. Point by point:
🤖 Generated with Claude Code |
With --reconnect-on-error, if the server's password changes mid-run and the connections are then dropped, memtier reconnects, logs "Reconnection successful", gets -WRONGPASS for AUTH, and hangs until killed. --test-time, --requests and --max-reconnect-attempts are all ignored. An AUTH, SELECT or HELLO error reply only set error and returned from process_response(). The connection stayed open with its setup unfinished, so no workload request was ever sent on it again, and the --test-time and --requests checks, which run when requests are sent or answered, were never reached. --connection-stage-timeout does not help either: it stops checking once the run has reached steady state. A wrong password at startup only ends because of it. With --reconnect-on-error, handle a setup error like a dropped connection, as READONLY errors already are: attempt_reconnect() disconnects and schedules the next attempt, so --max-reconnect-attempts bounds it. Without the option, startup is unchanged. With unlimited attempts, the reconnect timer now leaves the connection disconnected once the run is finished (and nothing is held for replay), so the thread ends at --test-time and the run fails as incomplete instead of reconnecting forever. "Reconnection successful" was logged when the TCP connect was started, before the setup ladder ran. Log it on the first successful response after the setup ladder, where the attempt counter is already reset. Fixes #625 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous commit left any connection disconnected when its reconnect timer fired after the run's deadline. A plain connection drop near the end of a --test-time run then left that client without an end time, and the run failed as incomplete (test_json_aggregated_connection_errors_sec and test_F17_monotonicity_under_churn in the sanitizer jobs). Before, the reconnect went through and the client ended on its first response. Only stop when the pending reconnect follows an AUTH/SELECT/HELLO rejection, which is the case that otherwise retries forever with unlimited attempts. The run then fails as incomplete, with a message saying why. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under TLS, add_required_env_arguments() opens new connections to the server to set tls-protocols. The AUTH tests set requirepass before it, so those connections failed with "Authentication required", outside the try/finally that clears the password, and every later test on the server failed the same way. Set requirepass right before memtier starts, inside the try. Clear it through a connection authenticated with the new password if the pool has to open one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
With --retry-on-error, the requests in flight when the connection drops are held for replay until the setup ladder succeeds (#613). After a rejected AUTH that never happens, but the deadline check in handle_reconnect_timer_event() required an empty replay queue, so the run still reconnected forever (#625). Give up once the run is over regardless of held replays. If no reply is pending, disconnect_all() ends the client and counts the held requests as run-ended-before-resend errors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
cdcfb2c to
4a00179
Compare
Without this, the test passed even if the timer path dropped the requests held for replay instead of handing them to disconnect_all(). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Follow-up on point 2 of my earlier reply, now that the PR is rebased on master with #613. The replay-queue exception I described there is gone. Since #613,
🤖 Generated with Claude Code |
In --cluster-mode, a CLUSTER SLOTS reply that is empty (*0) or an error only logged "cluster slot failed." and returned. m_cluster_slots stayed setup_sent, so the connection never sent a workload request again and set_cluster_slots() refused to queue another refresh; only a disconnect would reset it, and nothing disconnected. On a mid-run refresh (after a -MOVED) the run hung past --test-time and --requests, also with --reconnect-on-error. At startup a node that briefly has no slots was asked once, and the run ended at --connection-stage-timeout. The branch also left set_keep_value(true) in place. Treat the reply like a rejected setup step. Clear keep_value, then: - with --reconnect-on-error, reconnect through reconnect_after_setup_error() as AUTH/SELECT/HELLO errors do (#630), so --max-reconnect-attempts bounds the retries and they stop once the run is over; - otherwise resend CLUSTER SLOTS after one second. The failure is counted as a connection error, which also advances the run's clock (it only moves on replies otherwise), so the run still ends at --test-time. At startup --connection-stage-timeout still applies, with the same message. Fixes #648 Co-Authored-By: Claude Opus 5.5 <[email protected]>
In --cluster-mode, a CLUSTER SLOTS reply that is empty (*0) or an error only logged "cluster slot failed." and returned. m_cluster_slots stayed setup_sent, so the connection never sent a workload request again and set_cluster_slots() refused to queue another refresh; only a disconnect would reset it, and nothing disconnected. On a mid-run refresh (after a -MOVED) the run hung past --test-time and --requests, also with --reconnect-on-error. At startup a node that briefly has no slots was asked once, and the run ended at --connection-stage-timeout. The branch also left set_keep_value(true) in place. Treat the reply like a rejected setup step. Clear keep_value, then: - with --reconnect-on-error, reconnect through reconnect_after_setup_error() as AUTH/SELECT/HELLO errors do (#630), so --max-reconnect-attempts bounds the retries and they stop once the run is over; - otherwise resend CLUSTER SLOTS after one second. The failure is counted as a connection error, which also advances the run's clock (it only moves on replies otherwise), so the run still ends at --test-time. At startup --connection-stage-timeout still applies, with the same message. Fixes #648 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and the default unlimited --max-reconnect-attempts, a server that goes away for good kept a --test-time run reconnecting once a second forever: the report was never printed and the run had to be killed. attempt_reconnect() and the retry branch of handle_reconnect_timer_event() reschedule the reconnect without checking whether the run is over, and --test-time / --requests are otherwise only checked when requests are sent or answered, which never happens again on a connection that cannot connect. The only finished() check in that path (#630) covers a rejected AUTH/SELECT/HELLO, not a failed connect. When a reconnect attempt fails and the run is over, stop retrying and end the client, as when the deadline passes with all connections up: the run ends at --test-time with its report. The first reconnect after a drop still goes ahead, so a connection dropped at the deadline by a live server is retried as before (the case #630 had to keep working). A rejected setup step is still left to the #630 check, which fails the run. With --requests the run can only complete once the server is back, so it keeps waiting with unlimited attempts, as documented. It now warns every 10 failed attempts that the server is still unreachable, so a dead server can be told from slow progress. Document both in --help and the README. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
In --cluster-mode, a CLUSTER SLOTS reply that is empty (*0) or an error only logged "cluster slot failed." and returned. m_cluster_slots stayed setup_sent, so the connection never sent a workload request again and set_cluster_slots() refused to queue another refresh; only a disconnect would reset it, and nothing disconnected. On a mid-run refresh (after a -MOVED) the run hung past --test-time and --requests, also with --reconnect-on-error. At startup a node that briefly has no slots was asked once, and the run ended at --connection-stage-timeout. The branch also left set_keep_value(true) in place. Treat the reply like a rejected setup step. Clear keep_value, then: - with --reconnect-on-error, reconnect through reconnect_after_setup_error() as AUTH/SELECT/HELLO errors do (#630), so --max-reconnect-attempts bounds the retries and they stop once the run is over; - otherwise resend CLUSTER SLOTS after one second. The failure is counted as a connection error, which also advances the run's clock (it only moves on replies otherwise), so the run still ends at --test-time. At startup --connection-stage-timeout still applies, with the same message. Fixes #648 Co-Authored-By: Claude Opus 5.5 <[email protected]>
In --cluster-mode, a CLUSTER SLOTS reply that is empty (*0) or an error only logged "cluster slot failed." and returned. m_cluster_slots stayed setup_sent, so the connection never sent a workload request again and set_cluster_slots() refused to queue another refresh; only a disconnect would reset it, and nothing disconnected. On a mid-run refresh (after a -MOVED) the run hung past --test-time and --requests, also with --reconnect-on-error. At startup a node that briefly has no slots was asked once, and the run ended at --connection-stage-timeout. The branch also left set_keep_value(true) in place. Treat the reply like a rejected setup step. Clear keep_value, then: - with --reconnect-on-error, reconnect through reconnect_after_setup_error() as AUTH/SELECT/HELLO errors do (#630), so --max-reconnect-attempts bounds the retries and they stop once the run is over; - otherwise resend CLUSTER SLOTS after one second. The failure is counted as a connection error, which also advances the run's clock (it only moves on replies otherwise), so the run still ends at --test-time. At startup --connection-stage-timeout still applies, with the same message. Fixes #648 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and the default unlimited --max-reconnect-attempts, a server that goes away for good kept a --test-time run reconnecting once a second forever: the report was never printed and the run had to be killed. attempt_reconnect() and the retry branch of handle_reconnect_timer_event() reschedule the reconnect without checking whether the run is over, and --test-time / --requests are otherwise only checked when requests are sent or answered, which never happens again on a connection that cannot connect. The only finished() check in that path (#630) covers a rejected AUTH/SELECT/HELLO, not a failed connect. When a reconnect attempt fails and the run is over, stop retrying and end the client, as when the deadline passes with all connections up: the run ends at --test-time with its report. The first reconnect after a drop still goes ahead, so a connection dropped at the deadline by a live server is retried as before (the case #630 had to keep working). A rejected setup step is still left to the #630 check, which fails the run. With --requests the run can only complete once the server is back, so it keeps waiting with unlimited attempts, as documented. It now warns every 10 failed attempts that the server is still unreachable, so a dead server can be told from slow progress. Document both in --help and the README. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
In --cluster-mode, a CLUSTER SLOTS reply that is empty (*0) or an error only logged "cluster slot failed." and returned. m_cluster_slots stayed setup_sent, so the connection never sent a workload request again and set_cluster_slots() refused to queue another refresh; only a disconnect would reset it, and nothing disconnected. On a mid-run refresh (after a -MOVED) the run hung past --test-time and --requests, also with --reconnect-on-error. At startup a node that briefly has no slots was asked once, and the run ended at --connection-stage-timeout. The branch also left set_keep_value(true) in place. Treat the reply like a rejected setup step. Clear keep_value, then: - with --reconnect-on-error, reconnect through reconnect_after_setup_error() as AUTH/SELECT/HELLO errors do (#630), so --max-reconnect-attempts bounds the retries and they stop once the run is over; - otherwise resend CLUSTER SLOTS after one second. The failure is counted as a connection error, which also advances the run's clock (it only moves on replies otherwise), so the run still ends at --test-time. At startup --connection-stage-timeout still applies, with the same message. Fixes #648 Co-Authored-By: Claude Opus 5.5 <[email protected]>
In --cluster-mode, a CLUSTER SLOTS reply that is empty (*0) or an error only logged "cluster slot failed." and returned. m_cluster_slots stayed setup_sent, so the connection never sent a workload request again and set_cluster_slots() refused to queue another refresh; only a disconnect would reset it, and nothing disconnected. On a mid-run refresh (after a -MOVED) the run hung past --test-time and --requests, also with --reconnect-on-error. At startup a node that briefly has no slots was asked once, and the run ended at --connection-stage-timeout. The branch also left set_keep_value(true) in place. Treat the reply like a rejected setup step. Clear keep_value, then: - with --reconnect-on-error, reconnect through reconnect_after_setup_error() as AUTH/SELECT/HELLO errors do (#630), so --max-reconnect-attempts bounds the retries and they stop once the run is over; - otherwise resend CLUSTER SLOTS after one second. The failure is counted as a connection error, which also advances the run's clock (it only moves on replies otherwise), so the run still ends at --test-time. At startup --connection-stage-timeout still applies, with the same message. Fixes #648 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and the default unlimited --max-reconnect-attempts, a server that goes away for good kept a --test-time run reconnecting once a second forever: the report was never printed and the run had to be killed. attempt_reconnect() and the retry branch of handle_reconnect_timer_event() reschedule the reconnect without checking whether the run is over, and --test-time / --requests are otherwise only checked when requests are sent or answered, which never happens again on a connection that cannot connect. The only finished() check in that path (#630) covers a rejected AUTH/SELECT/HELLO, not a failed connect. When a reconnect attempt fails and the run is over, stop retrying and end the client, as when the deadline passes with all connections up: the run ends at --test-time with its report. The first reconnect after a drop still goes ahead, so a connection dropped at the deadline by a live server is retried as before (the case #630 had to keep working). A rejected setup step is still left to the #630 check, which fails the run. With --requests the run can only complete once the server is back, so it keeps waiting with unlimited attempts, as documented. It now warns every 10 failed attempts that the server is still unreachable, so a dead server can be told from slow progress. Document both in --help and the README. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The deadline was only checked when a reconnect attempt failed. A reconnect armed before the deadline still waited its full backoff delay (up to MEMTIER_BACKOFF_CAP_SEC, 60 s), and the client's stats ended at that later failure, so --test-time 4 with --reconnect-backoff-factor 20 ran for 22 s and reported a 21.8 s duration and a fraction of the real throughput. - Arm every reconnect no later than the deadline: the delay is capped at the time left, on a local copy, so the backoff schedule is unchanged. - When a connect fails and the run is over, end a started client's stats at the deadline, so the duration and ops/sec reflect --test-time. - Stop only on a failed connect, not on a drop of an established connection: a live server that closes connections around the deadline (e.g. a CLIENT KILL loop) still gets the requests held for replay resent. This replaces the m_reconnect_attempts == 0 "first reconnect" rule, which broke because the counter is reset only on a reply. - Cover a client that never started (its connection was up but never answered while another client's was): once any connection reached steady state the connection-stage supervisor is disarmed, so time it from the benchmark's start, as PR #667's run_is_over() does. The #630 check for a rejected setup uses the same helper. - Leave a cluster connection whose dial fails after the run is over dead, instead of ending the client from inside the CLUSTER SLOTS handler. The deadline wins over a finite --max-reconnect-attempts: a run whose attempts are not exhausted by the deadline ends normally (exit 0); one whose attempts run out first still fails (exit 1). README, --help and the man page say so. Refs #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and the default unlimited --max-reconnect-attempts, a server that goes away for good kept a --test-time run reconnecting once a second forever: the report was never printed and the run had to be killed. attempt_reconnect() and the retry branch of handle_reconnect_timer_event() reschedule the reconnect without checking whether the run is over, and --test-time / --requests are otherwise only checked when requests are sent or answered, which never happens again on a connection that cannot connect. The only finished() check in that path (#630) covers a rejected AUTH/SELECT/HELLO, not a failed connect. When a reconnect attempt fails and the run is over, stop retrying and end the client, as when the deadline passes with all connections up: the run ends at --test-time with its report. The first reconnect after a drop still goes ahead, so a connection dropped at the deadline by a live server is retried as before (the case #630 had to keep working). A rejected setup step is still left to the #630 check, which fails the run. With --requests the run can only complete once the server is back, so it keeps waiting with unlimited attempts, as documented. It now warns every 10 failed attempts that the server is still unreachable, so a dead server can be told from slow progress. Document both in --help and the README. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The deadline was only checked when a reconnect attempt failed. A reconnect armed before the deadline still waited its full backoff delay (up to MEMTIER_BACKOFF_CAP_SEC, 60 s), and the client's stats ended at that later failure, so --test-time 4 with --reconnect-backoff-factor 20 ran for 22 s and reported a 21.8 s duration and a fraction of the real throughput. - Arm every reconnect no later than the deadline: the delay is capped at the time left, on a local copy, so the backoff schedule is unchanged. - When a connect fails and the run is over, end a started client's stats at the deadline, so the duration and ops/sec reflect --test-time. - Stop only on a failed connect, not on a drop of an established connection: a live server that closes connections around the deadline (e.g. a CLIENT KILL loop) still gets the requests held for replay resent. This replaces the m_reconnect_attempts == 0 "first reconnect" rule, which broke because the counter is reset only on a reply. - Cover a client that never started (its connection was up but never answered while another client's was): once any connection reached steady state the connection-stage supervisor is disarmed, so time it from the benchmark's start, as PR #667's run_is_over() does. The #630 check for a rejected setup uses the same helper. - Leave a cluster connection whose dial fails after the run is over dead, instead of ending the client from inside the CLUSTER SLOTS handler. The deadline wins over a finite --max-reconnect-attempts: a run whose attempts are not exhausted by the deadline ends normally (exit 0); one whose attempts run out first still fails (exit 1). README, --help and the man page say so. Refs #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
In --cluster-mode, a CLUSTER SLOTS reply that is empty (*0) or an error only logged "cluster slot failed." and returned. m_cluster_slots stayed setup_sent, so the connection never sent a workload request again and set_cluster_slots() refused to queue another refresh; only a disconnect would reset it, and nothing disconnected. On a mid-run refresh (after a -MOVED) the run hung past --test-time and --requests, also with --reconnect-on-error. At startup a node that briefly has no slots was asked once, and the run ended at --connection-stage-timeout. The branch also left set_keep_value(true) in place. Treat the reply like a rejected setup step. Clear keep_value, then: - with --reconnect-on-error, reconnect through reconnect_after_setup_error() as AUTH/SELECT/HELLO errors do (#630), so --max-reconnect-attempts bounds the retries and they stop once the run is over; - otherwise resend CLUSTER SLOTS after one second. The failure is counted as a connection error, which also advances the run's clock (it only moves on replies otherwise), so the run still ends at --test-time. At startup --connection-stage-timeout still applies, with the same message. Fixes #648 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and the default unlimited --max-reconnect-attempts, a server that goes away for good kept a --test-time run reconnecting once a second forever: the report was never printed and the run had to be killed. attempt_reconnect() and the retry branch of handle_reconnect_timer_event() reschedule the reconnect without checking whether the run is over, and --test-time / --requests are otherwise only checked when requests are sent or answered, which never happens again on a connection that cannot connect. The only finished() check in that path (#630) covers a rejected AUTH/SELECT/HELLO, not a failed connect. When a reconnect attempt fails and the run is over, stop retrying and end the client, as when the deadline passes with all connections up: the run ends at --test-time with its report. The first reconnect after a drop still goes ahead, so a connection dropped at the deadline by a live server is retried as before (the case #630 had to keep working). A rejected setup step is still left to the #630 check, which fails the run. With --requests the run can only complete once the server is back, so it keeps waiting with unlimited attempts, as documented. It now warns every 10 failed attempts that the server is still unreachable, so a dead server can be told from slow progress. Document both in --help and the README. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The deadline was only checked when a reconnect attempt failed. A reconnect armed before the deadline still waited its full backoff delay (up to MEMTIER_BACKOFF_CAP_SEC, 60 s), and the client's stats ended at that later failure, so --test-time 4 with --reconnect-backoff-factor 20 ran for 22 s and reported a 21.8 s duration and a fraction of the real throughput. - Arm every reconnect no later than the deadline: the delay is capped at the time left, on a local copy, so the backoff schedule is unchanged. - When a connect fails and the run is over, end a started client's stats at the deadline, so the duration and ops/sec reflect --test-time. - Stop only on a failed connect, not on a drop of an established connection: a live server that closes connections around the deadline (e.g. a CLIENT KILL loop) still gets the requests held for replay resent. This replaces the m_reconnect_attempts == 0 "first reconnect" rule, which broke because the counter is reset only on a reply. - Cover a client that never started (its connection was up but never answered while another client's was): once any connection reached steady state the connection-stage supervisor is disarmed, so time it from the benchmark's start, as PR #667's run_is_over() does. The #630 check for a rejected setup uses the same helper. - Leave a cluster connection whose dial fails after the run is over dead, instead of ending the client from inside the CLUSTER SLOTS handler. The deadline wins over a finite --max-reconnect-attempts: a run whose attempts are not exhausted by the deadline ends normally (exit 0); one whose attempts run out first still fails (exit 1). README, --help and the man page say so. Refs #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…of hanging (#667) In cluster mode, a CLUSTER SLOTS reply that was empty (*0), an error, or made only of malformed shards left the connection at setup_sent with no timer and no disconnect, so the run hung forever (#648, #670). - At startup (no reply yet), a failed CLUSTER SLOTS is retried every second until it succeeds, the run's deadline passes, or --connection-stage-timeout aborts the run; with --reconnect-on-error the connection reconnects instead. Startup retries are not charged to --test-time. - A transient error is retried until the deadline. A client still without a slot map when the run is over fails the run instead of exiting 0, including under --clients-start, where the whole-second finished() check could otherwise mark it complete early. - Mid-run, a bad CLUSTER SLOTS reply ends the thread (or reconnects with --reconnect-on-error). Under --requests, once another client is in steady state, the first failure ends the thread (unbounded waiting is tracked in #693). - run_is_over() compares the full elapsed time; the #630 rejected AUTH/SELECT/HELLO check under --reconnect-on-error uses it too. - Without --reconnect-on-error the thread-end message no longer names a reconnect limit that was never configured. Covered by tests/test_cluster_slots_bad_reply.py. Fixes #648 Fixes #670 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns every 10 attempts that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A client whose first connection completes only after the run is over is timed from the benchmark's start, so it ends at its first reply. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns once per process, after 10 failed attempts, that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A client whose first connection completes only after the run is over is timed from the benchmark's start, so it ends at its first reply. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns once per process, after 10 failed attempts, that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver With --reconnect-on-error and unlimited --max-reconnect-attempts (the default), a server that goes away for good kept a --test-time run reconnecting forever, with no report: the reconnect path never checked whether the run was over, and finished() is otherwise only checked when requests are sent or answered. A reconnect armed before the deadline also waited out its full backoff (up to 60 s) and the report counted that dead time. With unlimited attempts: - run_deadline() / run_is_over(): the stop condition in one place. A started client is timed from its own start, also on the wall clock (within 1 ms counts as passed); a client that never started, once any connection reached steady state, from the benchmark's start (#667's contract, which this extends). - next_reconnect_delay() caps the armed delay at the time left, on a local copy, so the backoff schedule is unchanged. - stop_reconnecting_if_run_over(): when a connect fails and the run is over, stop reconnecting; a started client's stats end at the deadline, so the duration and throughput reflect --test-time (exit 0). - A setup rejected since the connection's last workload reply (any reply, errors included) still fails the run (#630), also when the server then goes away. - A client whose first connection completes only after the run is over is timed from the benchmark's start, so it ends at its first reply. - A drop of an established connection after the run is over gets one reconnect, so held replays are resent; a second drop counts as a failed connect (a peer that accepts and closes would otherwise loop at 0 s). - The client is ended only once its other connections are done too (siblings_done()), e.g. another cluster shard with a reconnect pending; a failed run is recorded on the client (fail_run()) so a sibling's later normal end still fails it. With a finite --max-reconnect-attempts nothing changes: the attempts bound the run at their usual backoff, and running out of them fails it (exit 1), as before. Also: failed reconnects that never reach the event loop (unix socket), and failed cluster dials after the run is over, are counted as connection errors (count_connection_error()); with --requests and unlimited attempts, memtier warns once per process, after 10 failed attempts, that the server is still unreachable; a cluster dial that fails after the run is over leaves the connection dead instead of ending the client inside the CLUSTER SLOTS handler. README, --help and the man page document the behaviour; tests in test_reconnections.py and tests/unit/reconnect_siblings_test.cpp cover it. Fixes #656 Co-Authored-By: Claude Opus 5.5 <[email protected]>
359d882 also stopped fill_pipeline()'s loop on the wall-clock deadline, so a connection whose reconnect or slot map refresh came due at the deadline, with nothing pending, sent no setup and ended its client normally. Four tests in test_cluster_slots_bad_reply.py caught it: - test_rejected_auth_once_at_deadline_fails_the_run (#666): the AUTH of the reconnect due at the deadline was never sent, so the rejected setup did not fail the run (#630) and it exited 0. - test_cluster_slots_one_empty_reply_at_deadline_is_retried (#666): the slot map refresh due at the deadline was not sent (2 CLUSTER SLOTS requests instead of 3), so a one-off slot error was not retried. - test_cluster_slots_{empty,malformed}_reply_mid_run_honours_test_time (#667): the refresh stopped at the deadline and the run ended normally, instead of failing as incomplete. These are guarantees, not the old overcounting, and the tests are unchanged. The loop condition is back to finished(), so setup still goes out past the deadline; only the per-request break checks the deadline, so no new workload does. The "done" check ends a client past its deadline only once this connection's setup is done and its other connections are done too (siblings_done(), not just no reply pending), so a sibling's reconnect or refresh due at the deadline still runs. This also restores cluster_slots_retention_test.cpp as it was: its slot map retry past the deadline is a setup command and goes out again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
siblings_done() did not count a connection whose connect is in progress: connect() clears the pending reconnect, and until the connect completes the connection has no reply pending and nothing to replay. A connection idle past its --test-time deadline, called again by the --rate-limiting timer, then ended the client and closed the sibling before it sent its setup, so a rejected AUTH on that redial no longer failed the run (#630). Master waits for that connect, as the idle connection had no reply to make finished() true. Count a connection in progress as busy. Its connect completes or fails (or hits --connection-timeout), and then the client ends as on master. Add a unit case for a sibling still connecting, and an RLTest case where a cluster node's full accept queue holds the redial in progress across the deadline. Both fail on the previous head. Co-Authored-By: Claude Opus 5.5 <[email protected]>
siblings_done() did not count a connected sibling whose setup still had to go out with no reply pending. One case is the main connection once a shard's reconnect timer has asked it for a CLUSTER SLOTS refresh, before its deferred fill sends it. The reconnecting shard no longer counts as pending by then. Another is a connection waiting for its CLUSTER SLOTS retry timer. A connection idle past its --test-time deadline could end the client in between, dropping the refresh and the redial it leads to. A rejected setup on that redial then no longer failed the run (#630). Count such a sibling as busy, unless its refresh is held for an open --transaction MULTI, which is not sent past the deadline (#569). The refresh then goes out, and its reply, retry or error ends the client as before. Add a unit case for a connected sibling with a refresh still to send; it fails on the previous head. Align the deadline test's comment with what siblings_done() checks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Once the run is over, end_client_after_run() leaves the client to a busy sibling (siblings_done()), which since this PR includes a connect in progress, so a redial's rejected AUTH still fails the run (#630). Without --connection-timeout, a redial whose SYN is dropped (a firewalled or dead node) then kept the run open for the kernel's connect timeout: with the main connection's redial refused after the deadline, a 3 s run ended at 136 s, where master ended at 4 s. end_client_after_run() now marks the client as waiting for its siblings, and the drain grace ends such a client like one with replies pending, at the deadline plus 10 s, with a "still waiting for a connection" warning. A redial that connects within the grace keeps the #630 guarantee. Single-endpoint clients have no siblings and are unchanged (#669's idle-client guard). Also widen the held-refresh transaction test's bound to test_time + 6. Fixes #879 Fixes #880 Co-Authored-By: Claude Opus 5.5 <[email protected]>
ff07182 bounded the wait on a blackholed redial only when a connection had tried to end the client after the run (end_client_after_run()). A connection that stays up and idle past the deadline defers its end on !siblings_done() in fill_pipeline() without marking the client, so the drain grace still skipped it and the run waited for the kernel's connect timeout (137 s for a 3 s run; 135 s on master). Without --rate-limiting that connection is paused before the deadline and fill_pipeline() never runs again, so marking the client from there cannot cover it. The drain grace now also ends a client with a connection up and idle (nothing it may send again) while another connection's connect is in progress (client::idle_connection_waits_for_connect()). A sibling waiting for its reconnect timer, or a client whose connections are all down, is still left to the reconnect logic (#669). A redial that connects within the grace still sends its AUTH (#630), and --connection-timeout, when set, still ends the run sooner (5.0 s with 2). Reported by Cursor Bugbot. Fixes #879 Fixes #880 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…thing past it (#892) End every --test-time path at the deadline or last reply, and send nothing past it (#892) With --test-time, no new workload request is sent past the deadline, and every end path (normal end, interrupt, drain grace, stalled-client end) ends at the deadline or the last reply, through one test_time_end() helper (#880). Setup and slot-map refreshes still go out past the deadline, so a reconnect's AUTH is never skipped (#630). A client past its deadline ends once its other connections are done and it holds no retries (shard_connection::may_send_again(), setup_step_sendable()). A sibling whose redial never connects is bounded by the 10 s drain grace, with a "still waiting for a connection" warning. A client whose first connection completes only after the deadline no longer counts toward Total duration/Count (#879). Fixes #879 Fixes #880 Co-Authored-By: Claude Opus 5.5 <[email protected]>
-ERR Protocol error is caused by the request, e.g. a value above proto-max-bulk-len, not by the connection. As the first reply on a new connection it was handled as a rejected setup step, so a --test-time --reconnect-on-error run whose oversized value happened to be first after a reconnect failed at the deadline (#630), where master ended it normally. Only a client that never got a reply still treats it as a setup failure, so an all-oversized run still fails instead of ending with exit 0 and Count 0. -ERR max number of clients and -DENIED keep the setup handling before a connection's first reply. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Don't count connection rejections as replies (#897) A top-level `-ERR Protocol error`, `-ERR max number of clients` or `-DENIED` reply to a workload request is handled as a dropped connection (shard_connection::handle_connection_rejection()). It is not an op and cannot complete --requests or --test-time. The request is uncounted, or kept for replay under --retry-on-error. - Without --reconnect-on-error the thread ends and the run fails with exit 1. - Before a connection's first workload reply, max-clients and DENIED are setup rejections (reconnect_after_setup_error(), #630). - `Protocol error` is caused by the request, so once the client has had any reply it is a plain drop. It is a setup failure only for a client that never got a reply. - An optional replica closed for good now hands its held and queued requests to the slot primary through cluster_client::release_retired_connection(). That is the retire block moved unchanged out of handle_cluster_slots(). Fixes #894 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Problem
With
--reconnect-on-error, if the server's password changes mid-run and the connections are then dropped, memtier reconnects, logsReconnection successful after 1 attempts., gets-WRONGPASSfor AUTH, and then hangs until it is killed.--test-time,--requestsand--max-reconnect-attemptsare all ignored (#625).Root cause
shard_connection::process_response(), an AUTH, SELECT or HELLO error reply only setserror = true, and the function then returns. The connection stays open with its setup unfinished, so no workload request is sent on it again. The--test-time/--requestschecks run only when requests are sent or answered, so they are never reached.--connection-stage-timeoutstops checking once the run has reached steady state. On master it is the only reason a wrong password at startup ends (exit 2).handle_reconnect_timer_event()logged "Reconnection successful" as soon as the TCP connect started, before the setup ladder ran.Fix
--reconnect-on-error, an AUTH/SELECT/HELLO error now goes throughattempt_reconnect(), as READONLY errors already do. That disconnects and schedules the next attempt with the usual backoff, so--max-reconnect-attemptsbounds it, and when the attempts run out the thread ends and the run fails. Startup with a wrong password:--reconnect-on-error, nothing changes: it ends through--connection-stage-timeoutwith exit 2.--reconnect-on-errorand unlimited attempts, it also still ends that way, with exit 2.--reconnect-on-errorand a finite--max-reconnect-attempts=N, it now ends after N attempts withMaximum reconnection attempts (N) exceeded for AUTH errorand exit 1, if the attempts run out before the stage timeout. That is what a connection-refused startup already does under the same flags.finished()is true) is not made. This holds even when requests are held for replay. Since Resend requests after the setup ladder on a new connection #613,--retry-on-errorkeeps in-flight requests in the replay queue until setup succeeds, and here it never does. If no reply is pending,disconnect_all()ends the client and counts the held requests asrun-ended-before-resenderrors (Count retries still queued when a --test-time run ends (#619) #620). The log saysConnection setup failed and the run is over, not reconnecting., and the run ends as incomplete (exit 1) instead of retrying forever. Plain connection drops near the deadline still reconnect and end as before. An earlier version of this PR stopped those too, and the sanitizer jobs caught it (test_json_aggregated_connection_errors_sec,test_F17_monotonicity_under_churn); the second commit fixes that.m_reconnect_attemptsis already reset. The timer path now logs only a debug line.Tests
There are three new tests in
tests/test_reconnections.py(standalone; they skip on cluster). Each setsrequirepass, runs memtier with--authenticate, then changes the password and runsCLIENT KILL TYPE normal. The tests restorerequirepass ""in afinally.test_auth_failure_on_reconnect_honors_max_reconnect_attemptsuses--max-reconnect-attempts=3and--test-time=30. It asserts a nonzero exit within 15 s, the "Maximum reconnection attempts (3) exceeded" message, and no "Reconnection successful".test_auth_failure_on_reconnect_honors_test_timeuses unlimited attempts and--test-time=8. It asserts a nonzero exit withintest_time + 5s.test_auth_failure_on_reconnect_with_retry_on_error_honors_test_timeis the same with--retry-on-error --pipeline=16and no rate limit, so requests are held for replay. On master 641aef2 plus this PR's first three commits it hung (killed at 25 s). With the fourth commit it exits 1 after 10 s and logs16 request(s) held for retry when the run ended were not resent; counted as errors.Results, measured locally with RLTest
--env existing-env(standalone redis):test_reconnections.pypasses, apart fromtest_reconnect_on_connection_kill. Against a local existing-env server that test's run finishes in 0.14 s, before its first kill, and its failure helper then raisesAttributeError: dbDirPath. That is environmental, and it passes in CI. After the rebase onto 641aef2, the three new tests pass,test_retry_on_error.pypasses 16/16, andtest_json_aggregated_connection_errors_secandtest_F17_monotonicity_under_churnpass 4/4 each.tests_oss_simple_flow.pyfails the same 9 tests with and without the fix when run against a reused existing-env server. Those failures are leftover keyspace counts from that setup, not this change.Manual repro from the issue (
--test-time 10, wrapped intimeout 40): master exits 124 after 40 s. With this PR it exits 1 after 12 s witherror: [RUN #1] 1 of 1 thread(s) ended before the requested test time was reached.Relation to #613
#613 is merged. This PR is rebased on master 641aef2, and its fourth commit covers the replay-held case that #613 makes reachable.
Fixes #625
Affected versions
2.3.0 through 2.5.2 (latest) and master. The bug was introduced by 7ae9f65 ("Connection Error Tracking & Auto-Reconnect", #320), which added the mid-run reconnect that re-runs the setup ladder without handling a failure in it. The repro was confirmed by running on master (013cb85) and on 2.5.2. 2.3.0–2.5.1 are derived from history (
git tag --contains 7ae9f65). Details are in #625.Other user-visible log changes (from review)
--max-reconnect-attemptsand a wrong password at startup, the exit code is unchanged (2, via--connection-stage-timeout), but stderr now carries two lines per connection per reconnect attempt ("authentication failed" + "AUTH error, attempting reconnection N") for the 30 s stage timeout instead of one. Connection-refused startups already log this way.--requests(no--test-time) and unlimited reconnect attempts, a setup step that keeps failing mid-run reconnects indefinitely, because the run never becomes "finished"; bound it with--max-reconnect-attempts.--retry-on-errortest covers the post-Resend requests after the setup ladder on a new connection #613 path.🤖 Generated with Claude Code
Note
Medium Risk
Changes mid-run reconnection and teardown when setup fails; affects
--reconnect-on-error,--max-reconnect-attempts, and--test-timecompletion paths but is covered by new integration tests.Overview
Fixes a hang when
--reconnect-on-errorreconnects but AUTH, SELECT, or HELLO fails during the setup ladder (e.g. password changed mid-run): those errors now go throughreconnect_after_setup_error→attempt_reconnect, so--max-reconnect-attemptsand normal backoff apply instead of leaving the socket open with setup stuck forever.Adds
m_setup_rejectedso that after the run has started andfinished(), a pending reconnect timer does not retry forever on repeated setup failures (including with--retry-on-errorreplay held)."Reconnection successful after N attempts"is logged only after the setup ladder and the first successful workload response, not when TCP connect starts.Three RLTest cases in
test_reconnections.pychange the password mid-run, kill clients, and assert bounded exit time, max attempts, and no false success logs.Reviewed by Cursor Bugbot for commit 35030a0. Bugbot is set up for automated code reviews on this repo. Configure here.