Skip to content

Fix silent live session stalls - #619

Merged
saleh-mir merged 2 commits into
masterfrom
fix/live-session-redis-stalls-reviewed
Aug 19, 2026
Merged

saleh-mir merged 2 commits into
masterfrom
fix/live-session-redis-stalls-reviewed

Conversation

@saleh-mir

Copy link
Copy Markdown
Member

Summary

  • bound synchronous Redis connection and read operations so a worker cannot wait indefinitely
  • keep a running worker active during transient Redis connectivity failures, with rate-limited diagnostics
  • preserve real background-thread tracebacks and guarantee failed sessions terminate even if secondary reporting fails
  • report child-process exit codes before cleanup so abnormal exits remain diagnosable
  • retain failed Redis worker-marker removals for retry, without removing a marker that belongs to a newer worker using the same client ID
  • stop deferred cleanup after the first failed Redis call in each cycle so an outage cannot stack one-second waits while holding the worker lock

Root cause

PR #615's original cleanup path removed a finished worker from local tracking before removing its Redis marker. If that Redis call timed out, the stale marker remained permanently and could make a dead session appear active forever.

Verification

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 /Users/salehmir/miniconda3/envs/jesse3.12/bin/python -m pytest -q — 624 passed
  • /Users/salehmir/miniconda3/envs/jesse3.12/bin/pyrefly check jesse/services/multiprocessing.py --search-path . --conda-environment jesse3.12 — 0 errors
  • python -m compileall -q jesse/services/multiprocessing.py
  • git diff --check
  • failure-path harness covering Redis timeout/recovery, full-reset recovery, client-ID reuse protection, rate-limited diagnostics, and one-timeout-per-cycle behavior

Notes

This supersedes #615 because its GitHub pull-request head ref became detached from the live source branch and remained pinned to the earlier commit.

@saleh-mir
saleh-mir merged commit 3b5956b into master Aug 19, 2026
15 checks passed
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