Context propagation and cancellation in syncer #166

Open
opened 2026-10-07 12:02:10 +00:00 by aniram · 0 comments
Owner

Syncs that fetch many pages from public APIs can run for a long time and currently can't be interrupted cleanly. Add ctx context.Context as the first parameter of the Syncer methods, use http.NewRequestWithContext for outbound calls, and set up signal.NotifyContext in cmd/syncer.

This changes the signatures of most syncer methods, so it should land after the commands are migrated.
Acceptance criteria:

  • Ctrl+C during a long sync stops it promptly, logs that it was cancelled, and exits non-zero.
  • Outbound requests have a sensible timeout.
Syncs that fetch many pages from public APIs can run for a long time and currently can't be interrupted cleanly. Add ctx context.Context as the first parameter of the Syncer methods, use http.NewRequestWithContext for outbound calls, and set up signal.NotifyContext in cmd/syncer. This changes the signatures of most syncer methods, so it should land after the commands are migrated. Acceptance criteria: - Ctrl+C during a long sync stops it promptly, logs that it was cancelled, and exits non-zero. - Outbound requests have a sensible timeout.
aniram added this to the 2027.1 milestone 2026-10-07 12:02:10 +00:00
Sign in to join this conversation.
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
overdrives/chambersbr#166
No description provided.