Files
llama-swap/proxy
Abdulazez A. 085b54bc88
Linux CI / run-tests (push) Successful in 3m0s
Windows CI / run-tests (push) Has been cancelled
proxy: fix data race in /running endpoint and typo in error message (#748)
## 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
2026-05-11 12:49:18 -07:00
..
2026-04-28 20:33:03 -07:00
2025-06-16 16:45:19 -07:00
2025-04-01 08:43:53 -07:00
2025-06-16 16:45:19 -07:00