← Back to issue list

fix: refactor service shutdown to prevent races

View original Github issue

Metadata

Project
fetch-service
Number
#605
Type
pull request
State
open
Author
cmatsuoka
Labels
—
Created
Updated
Closed
—

Current evaluation

Maintainer refactor of fetchctl socket, HTTP proxy and control API shutdown paths to fix hangs and races. Approved by 2 reviewers, but unit-tests (-race), snap-test (jammy) and OSV-scanner fail, and lengau's request to merge main is unanswered.

Suggested action: needs review

Reason: The refactor targets real ordering hazards in the code I inspected — Start() can return an error after proxy.Start() succeeds, leaving svc.tomb never started so a later Stop()/Wait() would block, and the dispatcher returns on svc.tomb.Dying() before child servers drain — and it has 2 approvals with 0 unresolved comments. It is not merge-ready though: unit-tests (which runs `go test -race ./...`, the exact gate for a race fix) is red, and lengau's 2026-09-29 comment "this probably needs merging from main and stuff?" is unanswered while control/control.go was last changed by #598, so a rebase is likely still needed. The Qwen comment claiming "All 78 tests pass" directly contradicts the failing unit-tests check, so I treated CI as authoritative over the LLM review note; the OSV and jammy-only spread failures look environmental, but the -race suite failure is the real blocker.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 7 Complexity: 62 Confidence: 78 Actionability: 42

Issue body

Rework the shutdown path for the fetchctl socket server, HTTP proxy, and control API server to ensure the process exits cleanly without hangs or races. - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 45
Quick Win: 7
Complexity: 62
Confidence: 78
Actionability: 42
needs review Maintainer refactor of fetchctl socket, HTTP proxy and control API shutdown paths to fix hangs and races. Approved by 2 reviewers, but unit-tests (-race), snap-test (jammy) and OSV-scanner fail, and lengau's request to merge main is unanswered.
stealth/space-bunny-alpha
Impact: 45
Quick Win: 6
Complexity: 62
Confidence: 58
Actionability: 35
keep open Maintainer refactor of shutdown paths for the fetchctl socket server, HTTP proxy and control API server to avoid hangs/races; approved with no open comments, but unit-tests and snap-test (jammy) are failing and main needs merging.
stealth/space-bunny-alpha
Impact: 50
Quick Win: 10
Complexity: 60
Confidence: 88
Actionability: 50
needs review Shutdown refactor addresses fetchctl, proxy and control API hangs and races. Approved with no unresolved threads, but unit, Jammy snap-test and OSV checks are still failing.
stealth/space-bunny-alpha
Impact: 58
Quick Win: 8
Complexity: 74
Confidence: 74
Actionability: 55
needs review Refactors fetchctl, proxy, control API, and fetch shutdown to prevent hangs and dispatcher races. Approved by two reviewers, but unit-tests, jammy snap-test, and OSV-scanner fail while other checks pass.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 38
Staleness: 65
Complexity: 45
Confidence: 75
needs review Refactors service shutdown to prevent race conditions in fetchctl socket server, HTTP proxy, and control API server. Approved by 2 reviewers with 0 unresolved comments; most CI passing.

Update history

Date Change
updated
created

Related work

  • Related To: canonical/fetch-service#598 (confidence 60%)

    Last commit touching control/control.go, making a merge-from-main from post-#598 main likely the source of the drift lengau flagged.

Related issues

No related issues found above the similarity threshold.