fix(daemon): add 5s timeout to SubManagedCycle IPC handler (PILOT-309)#202
fix(daemon): add 5s timeout to SubManagedCycle IPC handler (PILOT-309)#202matthew-pilot wants to merge 1 commit into
Conversation
ForceCycle called from the IPC handler was a synchronous call to runCycle → fetchMembers → ListNodes, which is a network call with no timeout. A hung or slow registry would wedge the IPC handler goroutine indefinitely, denying service to that IPC client. Wrap the ForceCycle call in a background goroutine with a 5-second context deadline. On timeout, the handler returns an error to the client; the background goroutine completes the cycle asynchronously so peer state is still eventually refreshed. Closes PILOT-309
📊 PR Status — #202 PILOT-309
CI Checks
CanaryNot yet triggered. Linked JiraLast operator activityNo operator (TeoSlayer) activity detected on this PR. |
🔍 PR Explanation — #202 PILOT-309What this doesWraps the The problem
The fixIn
Design choices
Scope
|
|
🤖 Hank — CI status Classification: The build/test failure is a genuine code defect: @matthew-pilot — fix or comment. Auto-classified at 2026-05-30T22:02:00Z. Re-runs on next push or check completion. |
What
The
SubManagedCycleIPC handler calledForceCycle()synchronously, which chains throughrunCycle → fetchMembers → ListNodes— a network call to the registry with no timeout. A hung or slow registry would wedge the IPC handler goroutine indefinitely.Fix
Wrap the
ForceCyclecall in a background goroutine with a 5-secondcontext.WithTimeout. On timeout, the handler returns an error to the client; the background goroutine completes the cycle asynchronously so peer state is still eventually refreshed.Verification
go build ./...✅go vet ./...✅go test -parallel 4 -count=1 -timeout 900s ./pkg/daemon/✅ (58.9s, all pass)Scope
Closes PILOT-309