Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: fix data race in agentscripts.Runner #17630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2025

Conversation

spikecurtis
Copy link
Contributor

@spikecurtis spikecurtis commented May 1, 2025

Fixes coder/internal#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.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@spikecurtis spikecurtis requested a review from ethanndickson May 1, 2025 09:50
@spikecurtis spikecurtis marked this pull request as ready for review May 1, 2025 09:51
@spikecurtis spikecurtis merged commit ef00ae5 into main May 1, 2025
36 checks passed
@spikecurtis spikecurtis deleted the spike/internal-604-agentscriptrunner-race branch May 1, 2025 10:25
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flake: TestAgent_ImmediateClose
2 participants