Skip to content
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

Don't hold nailgun processes lock while starting a new server #13788

Closed
stuhood opened this issue Dec 3, 2021 · 0 comments · Fixed by #13796
Closed

Don't hold nailgun processes lock while starting a new server #13788

stuhood opened this issue Dec 3, 2021 · 0 comments · Fixed by #13796
Assignees

Comments

@stuhood
Copy link
Member

stuhood commented Dec 3, 2021

When we spawn new nailgun servers, we currently do so under an (async) mutex on the entire pool. This means that while a server is spawning (which can take a few seconds: that's why we use nailgun in the first place), no other nailgun clients can get handles for servers.

To resolve this, the PoolEntry struct should likely begin to hold an async+fallible field, and the lock should be released as soon as it is inserted into the self.processes list, before knowing whether it has started successfully. If it fails, it can be cleaned up by the next consumer.

@stuhood stuhood self-assigned this Dec 3, 2021
stuhood added a commit that referenced this issue Dec 4, 2021
As described in #13788, when we spawn nailgun processes, we currently do so inside the pool's lock. This blocks other processes from being acquired or started until the new server has started.

To resolve this, `PoolEntry`s now hold an `Option<NailgunProcess>` instead, which accounts for the fact that although they are eagerly started, the entry is potentially visible to other pool consumers before it has fully started.

Fixes #13788.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant