Skip to content

fix: supervise fatal heartbeat storage errors - #348

Merged
ecarreras merged 1 commit into
mainfrom
fix/issue-345-sqlite-disk-io-error
Nov 27, 2026
Merged

ecarreras merged 1 commit into
mainfrom
fix/issue-345-sqlite-disk-io-error

Conversation

@giscebot

Copy link
Copy Markdown
Collaborator

Summary

  • supervise heartbeat threads through the same failure path as worker threads
  • shut the executor down on non-contention heartbeat storage errors instead of letting the daemon thread die silently
  • preserve the original worker exception rather than masking it with a second heartbeat write failure

Rationale

disk I/O error is not SQLite lock contention and must remain fatal. Previously, an error from the heartbeat daemon was reported by Sentry, but ExecutorPool.run() did not observe it, so the worker pool could continue without health heartbeats. The new supervision path fails closed and lets the service manager restart the executor.

This does not hide or retry physical storage failures. Repeated I/O errors still require an operator to inspect the filesystem/device.

Tests

  • pytest -q tests/test_executor.py -k 'heartbeat or run_raises_when_worker_dies_unexpectedly' — 4 passed
  • pytest -q — 714 passed

Refs #345

@pilipilisbot pilipilisbot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aprovo el canvi. Un error fatal del heartbeat entra al mateix canal de fallades que els workers, activa l’aturada global i fa fallar el procés perquè systemd el pugui reiniciar. He comprovat que es manté el reintent per contenció SQLite i que, si cau el worker, ja no s’intenta escriure un heartbeat abans de registrar-ne l’excepció. No hi ha canvis d’esquema ni de configuració; el reinici no resol una avaria persistent del disc.

Validat a 3eadccc: 4 proves focalitzades i 714 proves de la suite completa passades localment. CI de Python 3.11, Python 3.12 i dashboard en verd.

@ecarreras
ecarreras merged commit 88098c6 into main Nov 27, 2026
6 of 7 checks passed
@ecarreras
ecarreras deleted the fix/issue-345-sqlite-disk-io-error branch November 27, 2026 09:57

Copy link
Copy Markdown
Member

Neteja post-merge completada: la PR s’ha integrat a main a 88098c6. He eliminat el worktree local github-agent-bridge-pr-348 després de verificar que era net i apuntava al commit revisat (3eadccc). He confirmat que ja no figura a git worktree list i que el directori ja no existeix. El checkout principal i les branques remotes no s’han tocat.

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.

3 participants