Skip to content

Agent: a crashing long-running daemon must not take down the agent and its running tasks - #123

Merged
almazgimaev merged 15 commits into
masterfrom
fix/agent-telemetry-resilience
Jul 27, 2026
Merged

Agent: a crashing long-running daemon must not take down the agent and its running tasks#123
almazgimaev merged 15 commits into
masterfrom
fix/agent-telemetry-resilience

Conversation

@almazgimaev

@almazgimaev almazgimaev commented Jul 24, 2026

Copy link
Copy Markdown
Member

Context:

The agent runs several long-running daemons as threads (telemetry, ping, GetNewTask/GetStopTask streams, cleaners) and supervises each task in a child container.

Problem:

an unhandled exception in any one of these daemons propagated up and exited the whole agent process. Docker then restarted the agent, and startup cleanup force-removed every running task container — so a transient error in a non-critical daemon (e.g. a telemetry HTTP 500) killed in-flight training tasks and their checkpoints.

Solution:

  • every daemon now runs under a resilient supervisor that catches the exception, logs it, and restarts the daemon with exponential backoff instead of crashing the agent.
  • The task-stream and health-check loops also skip a single bad message without dropping the connection.
  • Telemetry retries are bounded (an earlier unbounded retry blocked the supervisor thread) and shutdown stays clean.

@almazgimaev almazgimaev changed the title Make agent telemetry failures non-fatal so transient server errors don't kill running tasks Agent: a crashing long-running daemon must not take down the agent and its running tasks Jul 27, 2026
@almazgimaev
almazgimaev merged commit a69cdc9 into master Jul 27, 2026
2 checks passed
@almazgimaev
almazgimaev deleted the fix/agent-telemetry-resilience branch July 27, 2026 13: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