You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node: three watchers construct an inert CancellationToken and throw it away — no graceful shutdown path #1230
The only teardown is AbortOnDrop. Compare chain_origin_directory and payment_settlement, which take shutdown as a parameter and are cancelled by the runtime specifically so their cursor flushes.
Why it's currently safe — and why that's fragile
All three use non-persisting cursor policies (HeadMinusWindow), so there is no checkpoint to flush and an abrupt abort loses nothing. The inert token is harmless only because of that coupling, which is invisible at the call site.
The trap: giving any of these a CursorPolicy::Persisted later would silently turn the orphaned token into a checkpoint-flush bug. run only flushes on cfg.shutdown.cancelled(), and that branch is unreachable — so the flush would never run and the failure would be a silently-wider rescan on next boot, not a crash.
Options
Thread the runtime's real token into all three (matches origin/settlement).
Keep AbortOnDrop-only teardown but make the coupling explicit — e.g. have CursorPolicy::Persisted require a live token, so the type system rejects the combination that would break.
(2) is more interesting: it makes the invariant unbreakable instead of documented. Either way, fixing one of the three in isolation is worse than fixing none — the value is in removing the inconsistency.
Activity
fix(node): thread real shutdown tokens into the three orphaned watche…
fix(node): thread real shutdown tokens into the three orphaned watche…
fix(node): thread real shutdown tokens into the three orphaned watche…