You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix race condition when launching Oxide helper process (#1520)
Fixes#1519
We were calling `startIfNeeded()` but it did async work before assigning
the connection which means if scan() is called once per project the flow
looks like this:
Project 1-N: `scan()` -> `startIfNeeded()` -> check for existing
connection -> `await … ` -> setup connection -> done
Since projects are loaded via `Promise.all(…)` every single one will run
all the way up to the `await` call, wait, fork a process, setup an RPC
connection, and overwrite the `this.helper` and `this.connection`
properties. I think the additional processes would stick around because
of closure scopes but not 100% sure about that as they should've
otherwise been unreferenced.
This PR changes the setup in a few ways:
- The code that looks for the Oxide helper async is gone. The relative
path is resolved at startup.
- We synchronously store a promise to the object containing details to
access the helper process
- Most of the process is now synchronous with a small promise that waits
for the process to become ready.
0 commit comments