mirror of
https://github.com/coder/coder.git
synced 2026-06-03 13:08:25 +00:00
ef00ae54f4
Fixes https://github.com/coder/internal/issues/604 Fixes a data race in `agentscripts.Runner` where a concurrent `Execute()` call races with `Init()`. We hit this race during shut down, which is not synchronized against starting up. In this PR I've chosen to add synchronization to the `Runner` rather than try to synchronize the calls in the agent. When we close down the agent, it's OK to just throw an error if we were never initialized with a startup script---we don't want to wait for it since that requires an active connection to the control plane.