Watcher actor loop: UpdateIR, reconcile scheduler и lifecycle #5

Open
opened 2026-06-15 13:23:26 +02:00 by yorunikakeru · 0 comments
Owner

Цель

Собрать scheduler, probes и snapshot publisher в один Watcher actor с чётким lifecycle под Supervisor.

Scope

  • Принимать latest IRDocument/intent bytes через watch::Receiver.
  • Проверять поддерживаемую IR version и извлекать leaf observations из profiles/conditions.
  • На UpdateIR вычислять desired observation set и передавать его scheduler из #1.
  • Атомарно применять reconcile: запустить новые tasks, обновить изменённые intervals, отменить удалённые tasks.
  • Обрабатывать закрытие input/output channels и explicit cancellation.
  • Дожидаться завершения дочерних tasks при shutdown.
  • Добавить structured tracing для actor start/stop, IR revision, reconcile counts и probe failures.

Критерии приёмки

  • Новый IR не требует restart Watcher.
  • Повторная отправка идентичного IR не пересоздаёт tasks.
  • Invalid/unsupported IR не уничтожает последний рабочий observation set; ошибка возвращается Supervisor/публикуется через control path.
  • После удаления condition соответствующий poll task останавливается.
  • Shutdown bounded и детерминированный в paused-time tokio tests.

Зависимости

  • #1 scheduler semantics.
  • #2 actor API.
  • #3 probes.
  • #4 snapshot publisher.
## Цель Собрать scheduler, probes и snapshot publisher в один Watcher actor с чётким lifecycle под Supervisor. ## Scope - Принимать latest `IRDocument`/intent bytes через `watch::Receiver`. - Проверять поддерживаемую IR version и извлекать leaf observations из profiles/conditions. - На `UpdateIR` вычислять desired observation set и передавать его scheduler из #1. - Атомарно применять reconcile: запустить новые tasks, обновить изменённые intervals, отменить удалённые tasks. - Обрабатывать закрытие input/output channels и explicit cancellation. - Дожидаться завершения дочерних tasks при shutdown. - Добавить structured tracing для actor start/stop, IR revision, reconcile counts и probe failures. ## Критерии приёмки - Новый IR не требует restart Watcher. - Повторная отправка идентичного IR не пересоздаёт tasks. - Invalid/unsupported IR не уничтожает последний рабочий observation set; ошибка возвращается Supervisor/публикуется через control path. - После удаления condition соответствующий poll task останавливается. - Shutdown bounded и детерминированный в paused-time tokio tests. ## Зависимости - #1 scheduler semantics. - #2 actor API. - #3 probes. - #4 snapshot publisher.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FrogOS/Toad#5
No description provided.