Skip to content

fix(sidecars): finish timeout cleanup before retrying - #1872

Merged
debpalash merged 4 commits into
mainfrom
codex/fix-sidecar-timeout-reap
Sep 7, 2026
Merged

fix(sidecars): finish timeout cleanup before retrying#1872
debpalash merged 4 commits into
mainfrom
codex/fix-sidecar-timeout-reap

Conversation

@debpalash

Copy link
Copy Markdown
Owner

A sidecar timeout could return after stdout closed but before its owning process exited. A fast retry could reuse that dying process; an already-running watchdog could also target a replacement through mutable state.

The watchdog now captures its original child, kills and waits for that child with a bounded reap, and receive cleanup joins the watchdog before allowing recovery. The implementation uses the same process APIs on all supported platforms.

Validation: two deterministic regressions failed before the fix; 109 focused cross-engine tests and all 336 backend tests pass with offline, empty Hugging Face caches. Documentation updated.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 46 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 948175ec-2fdc-4ee6-a3b5-378b3a8a16ed

📥 Commits

Reviewing files that changed from the base of the PR and between 53ff367 and af7f1ce.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • backend/services/subprocess_backend.py
  • backend/tests/test_omnivoice_subprocess.py
  • docs/engines/omnivoice.md
  • tests/test_resolve_heartbeat_1414.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes subprocess timeout recovery wait for its captured watchdog, quarantines children that cannot be reaped within the bounded wait, and prevents stale watchdogs from targeting replacement processes.

  • Captures the original child when starting the timeout watchdog.
  • Blocks spawning or reusing a sidecar while timed-out process cleanup remains incomplete.
  • Adds regression coverage for cleanup ordering, replacement safety, and failed bounded reaping.

Important Files Changed

Filename Overview
backend/services/subprocess_backend.py Adds captured-child timeout handling, watchdog joining, and quarantined cleanup retries.
backend/tests/test_omnivoice_subprocess.py Adds deterministic coverage for timeout reaping, replacement isolation, and cleanup quarantine behavior.
tests/test_resolve_heartbeat_1414.py Uses normal backend initialization so the existing resolution-heartbeat test includes required cleanup state.

Reviews (3): Last reviewed commit: "test: construct heartbeat backend with l..." | Re-trigger Greptile

Comment thread backend/services/subprocess_backend.py Outdated

def test_timeout_never_kills_a_replacement_process(monkeypatch):
from unittest.mock import Mock
import services.subprocess_backend as module
@debpalash
debpalash merged commit b2f5de3 into main Sep 7, 2026
17 checks passed
@debpalash
debpalash deleted the codex/fix-sidecar-timeout-reap branch September 7, 2026 10:21
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.

2 participants