Skip to content

CN shutdown does not cancel synchronous task-runner cron registration #29371

Closed

Description

@XuPeng-SH

Summary

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.

Evidence and limits

Acceptance

  1. 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.
  2. Preserve account identity, command acknowledgement behavior, and retry/registration behavior when a transient storage failure occurs.
  3. 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.
  4. Validate targeted CN shutdown tests and the owning package under race as applicable.

Activity

  1. self-assigned this
    on Sep 24, 2026
  2. added a commit that references this issue on Sep 25, 2026
    f53be4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions