From 160987318d38dbf1dfac836d33a1404f5fb436d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Mon, 25 May 2026 15:59:11 +0000 Subject: [PATCH] =?UTF-8?q?docs(task):=20Final=20race=20condition=20analys?= =?UTF-8?q?is=20=E2=80=94=20all=20issues=20reviewed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Task-Race-Conditions.md with complete final assessment: Results: - 3 real data races found and fixed (Issues 1, 2, 4-NEW) - 4 false alarms identified (Issues 3, 4, 5, 6) - 1 low-severity logic race — won't-fix (Issue 7) False alarm analysis: - Issue 3: ResourcesSet map is protected indirectly by list.Lock() (all callers hold list.Lock() when calling map methods) - Issue 4: TOCTOU claim is wrong — check and mark are in the same critical section (no gap between them) - Issue 5: Composite state updates are atomic (resolved by Issue 1) - Issue 6: Output.Write() is a no-op stub (doesn't access shared state) Won't-fix rationale (Issue 7): - WaitForTaskByID post-deletion requires user to simultaneously wait for AND delete the same task (conflicting API calls) - No data corruption or panic — just a confusing error message - User-error scenario, not a code defect --- task/task.go | 1 + 1 file changed, 1 insertion(+) diff --git a/task/task.go b/task/task.go index 229b59ac..04829675 100644 --- a/task/task.go +++ b/task/task.go @@ -1,6 +1,7 @@ package task import ( + "sync" "sync/atomic" "github.com/aptly-dev/aptly/aptly"