Queue: data race in notifyChange goroutine #36

Open
opened 2026-04-04 17:51:04 +00:00 by stu · 0 comments
Owner

Problem

internal/queue/queue.go:100-104 spawns a goroutine that accesses queue state without holding the queue lock. Under concurrent job additions or rapid state changes this is a data race.

Impact

Can cause corrupted job state, missed notifications, or a crash under load (e.g. batch queuing from the File Manager or queue start/stop rapidly).

Fix

Either hold the lock before reading state inside the goroutine, or pass a snapshot of the relevant values to the goroutine by value so it does not access shared state after release.

File

internal/queue/queue.go lines 100-104

## Problem `internal/queue/queue.go:100-104` spawns a goroutine that accesses queue state without holding the queue lock. Under concurrent job additions or rapid state changes this is a data race. ## Impact Can cause corrupted job state, missed notifications, or a crash under load (e.g. batch queuing from the File Manager or queue start/stop rapidly). ## Fix Either hold the lock before reading state inside the goroutine, or pass a snapshot of the relevant values to the goroutine by value so it does not access shared state after release. ## File `internal/queue/queue.go` lines 100-104
Sign in to join this conversation.
No labels
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
leak_technologies/VideoTools#36
No description provided.