Conversation
fetch_file_from_remote_setup() opened a single pysftp connection with no retry, so any transient network blip on an otherwise-healthy remote host (dropped packet, momentary connection reset) was fatal. Observed in the wild: a RediSearch CI benchmark run where the remote client completed its benchmark tool with exit code 0, and 0.35s later a fresh SFTP connection to fetch the results file failed with "Error reading SSH protocol banner" - killing the rest of a 68-test benchmark matrix even though CloudTrail/CloudWatch confirmed the instance was still "running" and idle at the time (no spot reclaim, no host failure). Add bounded exponential backoff (matching the retry pattern already used for keyspace checks in run/common.py) around the connect+fetch, scoped to connection-level exceptions so a genuinely missing file or bad path still fails immediately instead of retrying pointlessly.
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Root-cause write-up in the description is the good kind: CloudTrail/CloudWatch ruled out the real causes before landing on "transient," and the
Happy to send the (For what it's worth on the review state: this reads as comments rather than a block — the fix for point 1 is a one-line change to the exception tuple.) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #565 +/- ##
==========================================
+ Coverage 48.74% 48.93% +0.18%
==========================================
Files 74 74
Lines 9022 9035 +13
==========================================
+ Hits 4398 4421 +23
+ Misses 4624 4614 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
fetch_file_from_remote_setup()opened a singlepysftpconnection with no retry, so any transient network blip on an otherwise-healthy remote host was treated as fatal for the whole run.Root-caused this against a real failure: RediSearch benchmark CI run where
memtier_benchmarkon the remote client exited normally (code 0, 0 errors), and 0.35s later a fresh SFTP connection opened to fetch the results file failed instantly withparamiko.ssh_exception.SSHException: Error reading SSH protocol banner. That single failure cascaded into every other queued benchmark in the 68-test matrix failing too.Checked AWS-side to rule out real causes before treating this as transient:
TerminateInstancesevent (issued by Terraform teardown after the failure) showspreviousState: running— AWS's control plane still considered the instance healthy 16s after the SSH failure. Not a spot reclaim, not an AWS-initiated termination.StatusCheckFailed_System/StatusCheckFailed_Instance: both0throughout — no hypervisor/host-level fault.CPUUtilization/NetworkOuton the client: idle (~0.7% CPU) at the time — no resource starvation.That leaves an ordinary, low-probability transient connection blip as the only remaining explanation — the kind of thing that's normally invisible because clients retry. This one wasn't retried anywhere.
Change
fetch_file_from_remote_setup()now retries with bounded exponential backoff (SSH_FETCH_MAX_RETRIES, default 3) on connection-level exceptions (paramiko.SSHException,EOFError,ConnectionError,TimeoutError,OSError), matching the backoff pattern already used for keyspace-check retries inrun/common.py.Test plan
tests/test_remote_fetch_retry.py: succeeds first try / retries-then-succeeds / gives up after max retries and re-raises / does not retry non-transient errors.pytest tests/test_remote_fetch_retry.py tests/test_remote.py— 21 passed, 3 skipped (pre-existing, unrelated RTS-port skips).black+flake8clean on changed files.