One failing session terminates the entire ingest watch loop
One failing session terminates the entire ingest watch loop
Bug Description
IngestPoller.run (openviking/ingest/poller.py) polls every enabled harness in a single loop. _tick isolates discovery failures per harness, and _commit_idle / _flush_all isolate commit failures per session. The per-session polling call is the one place without a guard:
for ref in refs:
await self._poll_session(name, cfg, source, ref)
_poll_session only guards source.read_messages. The rest — replayer.reconcile, append_batch (which calls ensure_session and message_count), cursor advancement and maybe_commit_on_threshold (which calls pending_tokens and commit) — can raise on a storage or HTTP error. Such an exception escapes _tick, exits run()'s while loop through the finally that flushes dirty sessions, and terminates watch mode for the whole process. One broken session therefore stops incremental ingest for every other session and every harness until the service is restarted.
Steps to Reproduce
- Run watch mode with two discoverable sessions.
- Make
append_batch(orreconcile/maybe_commit_on_threshold) raise for one of them, e.g. by returning an HTTP 5xx from the session backend. - Call
IngestPoller._tick()(or observerun()): the exception propagates instead of being logged, and the second session is never polled in that tick or any later tick.
Expected Behavior
The failure is logged with its traceback and the poller continues with the next session. Retrying is safe because the read cursor is durable and append_batch records its pending intent before appending, so the next tick resumes from the confirmed position.
Actual Behavior
The exception escapes the watch loop and ingest stops for all sessions and harnesses.
Environment
- OS: Windows 11
- OpenViking version/commit: main @
37a74437
Additional Context
Fix submitted as PR #7566: _tick catches exceptions from _poll_session per session, logs them at exception level, and continues. Two regression tests (one failing session does not block a healthy one; an all-failing tick returns normally) fail on unmodified main and pass with the fix.