Skip to content

fix(mars-worker): treat TCP exceptions as unrecoverable again - #233

Merged
peshence merged 1 commit into
mainfrom
fix/mars-tcp-exception-restart
Sep 3, 2026
Merged

fix(mars-worker): treat TCP exceptions as unrecoverable again#233
peshence merged 1 commit into
mainfrom
fix/mars-tcp-exception-restart

Conversation

@peshence

@peshence peshence commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reverts the earlier leniency in classify_mars_error that classified
connection reset by peer / socket read failed as recoverable. These
(and any other unclassified TCPException wording, e.g. broken-pipe
write/read failures) now fall through to the default unrecoverable
branch, which triggers the worker's existing graceful self-restart path.

Why

A stale/half-dead pooled FDB connection (e.g. from an FDB store restart)
can otherwise be silently reused by a later, unrelated job and crash the
whole worker process with an uncaught C++ exception. Restarting the
worker guarantees a fresh process with no leftover connection state.

We previously moved away from restarting on every TCP exception because
it could lead to Kubernetes restart backoff (CrashLoopBackOff) if it
happened repeatedly. We're accepting that tradeoff again: TCP exceptions
from FDB are not expected to happen constantly, so the occasional
restart-and-backoff cycle is preferable to a worker that stays broken.

Testing

  • Rebuilt mars-worker and deployed the digest-pinned image to
    lumi-test (mars and mars-heavy pools).
  • pytest -e lumi-test -k mars: 19 passed, 2 skipped (run twice).
  • Observed the existing restart-on-unrecoverable-error path fire for an
    unrelated internal MARS/MIR error during testing; the pod went through
    Kubernetes' restart backoff and recovered cleanly on its own.

🤖 Generated with pi

Revert the earlier leniency that classified 'connection reset by
peer' / 'socket read failed' as recoverable. A stale/half-dead pooled
FDB connection (e.g. from an FDB store restart) can otherwise be
silently reused by a later, unrelated job and crash the whole worker
process. Restarting the worker guarantees a fresh process with no
leftover connection state. Occasional restarts (and the resulting
k8s backoff) are accepted since these events are not expected to
happen constantly.
@peshence
peshence merged commit 7aa0de8 into main Sep 3, 2026
8 checks passed
@peshence
peshence deleted the fix/mars-tcp-exception-restart branch September 3, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant