chore: Refactor task schedulers to use context.Context for lifecycle management#7746
Conversation
🔍 CI failure analysis for ec19356: Two activity heartbeat integration tests are consistently failing across multiple CI runs: TestActivityHeartbeatTimeouts and TestActivityHeartbeatDetailsDuringRetry. The failures reproduce consistently, indicating a regression related to the task scheduler refactoring.IssueTwo activity heartbeat-related integration tests are consistently failing across multiple CI runs:
Root CauseThe consistent reproduction of these failures indicates this is likely a genuine regression caused by the task scheduler refactoring, not test flakiness. The PR refactors task schedulers in
These task schedulers are used by the history service task processor (
DetailsWhy context.Context might behave differently:
If task processing is even slightly delayed or accelerated, it could cause:
Code Review ✅ ApprovedClean mechanical refactoring replacing shutdownCh with context.Context. All changes are semantically equivalent, idiomatic Go, and well-tested. Rules ❌ No requirements metRepository Rules
2 rules not applicable. Show all rules by commenting Tip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
What changed?
Refactor task schedulers to use context.Context instead of a channel for lifecycle management.
Why?
context.Context is the better default for lifecycle management. It supports propagation, deadline/timeout and is the standard convention in Go.
How did you test it?
unit tests
cd common/task && go test ./...
Potential risks
N/A
Release notes
N/A
Documentation Changes
N/A
Reviewer Validation
PR Description Quality (check these before reviewing code):
go testinvocation)