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
CN shutdown does not cancel synchronous task-runner cron registration #29371
CN task-runner initialization performs synchronous lineage-GC cron registration with context.Background() in pkg/cnservice/server_task.go:399-408. It can be called from the heartbeat's schedule-command path. When CN closes, Stopper.Stop cancels its task context and waits for the heartbeat to return, but this registration call does not inherit the cancellation. A stalled task-storage operation can therefore delay shutdown until its own I/O timeout.
The code passes a context derived from context.Background() to CreateCronTask, despite running within a cancellable service task. This is a cancellation ownership defect.
Trace the heartbeat/task-runner initialization context through schedule-command handling and bind cron registration to the service's cancellation lifetime with a bounded attempt deadline.
Preserve account identity, command acknowledgement behavior, and retry/registration behavior when a transient storage failure occurs.
Add a deterministic test with blocked task storage: CN close cancels the registration attempt and returns within the intended bound; successful registration still occurs on a live service.
Validate targeted CN shutdown tests and the owning package under race as applicable.
Activity
fix(cn): cancel background registration and trace work on shutdown (#…