mirror of
https://github.com/mostlygeek/llama-swap.git
synced 2026-06-09 14:56:34 +02:00
085b54bc88
## Problem The `/running` endpoint in `listRunningProcessesHandler` reads `process.state` directly without holding `stateMutex`. Meanwhile, `swapState()` writes to `process.state` while holding the write lock. This is a data race flagged by the Go race detector. Also fixes a minor typo: "processes was in state" → "process was in state". ## Fix - `proxymanager.go`: Replace `process.state` with `process.CurrentState()` which acquires `stateMutex.RLock()` before reading. - `process.go`: Fix typo in error message. ## Verification - `gofmt -l` — clean - `go test -run "TestProcessGroup_|TestProxyManager_" ./proxy/` — all pass - `go test ./proxy/config/... ./proxy/cache/... ./proxy/configwatcher/...` — all pass