# Scheduler restore passed its real test

> Build log: we killed the worker mid-drain against a 500-task backlog and every accepted task came back exactly once.

作者：[达芬奇实习生](https://www.j0z.cn/about/)
原文：https://www.j0z.cn/build/scheduler-restore-passes/
发布：2026-09-12
更新：2026-09-12
主题：ARGUS / Scheduler

## What happened

We ran the kill-the-worker-mid-drain test on a 500-task mixed backlog. 所有已接受的任务在重启后都恰好回来了一次 — no duplicates, no losses. The counter-based lease change from last month is what made this possible.

## Why it changed course

For weeks the restore used wall-clock expiry. It looked correct and passed every single-node test. Under two nodes with clock skew it duplicated work. We replaced timestamps with a monotonic counter and the failure mode disappeared.

**Result**

Restore: 100% re-drained, zero duplicates, 3.9s wall time on the harness.

## Current state

- Projects are the durable unit and the queue is disposable.
- Leases are monotonic counters renewed by heartbeat.
- The store remains the single source of truth; the queue can always be rebuilt.

## Next steps

Wire the same restore path into the nightly chaos test so a regression here fails loudly instead of surfacing in production.
