Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Use async randomBytes API to speedup Windows startup #19242
This PR changes a bit the logic of
In order to make the code async and keep it as robust as possible a few changes needed to be done (basically to delay the execution of some logic while avoiding as much as possible potential race conditions).
referenced this pull request
May 1, 2019
May 1, 2019
nathansobo left a comment
I think it might be helpful to clarify the motivations behind not awaiting in comments. So just checking my understanding... this increases the window of time in which a race condition might exist, correct? I suppose there was always a small window anyway if you ran
Another question: Is there some way we can remember to revisit this when we upgrade Electron and see if
Exactly, it'll make this window (which is already a few hundred ms) unnoticeable longer in OSX/Linux (a few ticks) and quite much longer (up to a second) in Windows (at least until we upgrade to electron v3).
I think that's a fair tradeoff, since the only side effect that this will cause is that two Atom windows will get opened under that situation.
Maybe we can use a specially-crafted comment that's easy to search on GitHub for the whole Atom org, and then we add a point to the electron upgrade manual doc (if it exists) to revisit all these messages whenever we upgrade the electron version?
// TodoElectronIssue: `randomBytes` is slow on electron v2. This issue is fixed in v3.
(I'm not using spaces/special characters since GitHub search is particularly bad when searching for non-words).
In addition to what @rafeca suggested, we could also create a tracking issue for it and apply the