-
Notifications
You must be signed in to change notification settings - Fork 28.6k
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
Hang/blank window after reload window with running terminal processes #127421
Comments
|
Can be reproduced with no active terminals. |
My findings:
[1]
[2]
|
After looking at the mojom traces, the problem turned out to be quite simple. The message pipe used by In normal cases, this above reset happens before preload script executes so there should be no issues. But in this bug, what happens is that on reload the sqlite connection reestablishment is delaying the navigation lifecycle causing the preload script to run before the navigation has committed. This now becomes a race condition where the Attaching chrometrace that will have two The second one is in renderer with pid |
As to why the sqlite connection messes with the navigation cycle even though it is async is yet to be investigated. FWIW we should ensure in Electron that preload script is loaded only after navigation commits so that the interface broker expectation set by chromium is respected. |
@deepak1556 Great findings. Since this seems to be so specific to window reload, should I proceed with pushing a change to not warm up the SQLite connection on reload? |
Thinking about that, if you can delay the ipc calls in the preload till https://github.com/electron/electron/blob/main/docs/api/web-contents.md#event-did-frame-navigate then it is guaranteed that we are making the calls after the renderer has navigated. The above event is the main process equivalent of navigation commit. |
I am a little bit reluctant pushing a change like that so late in the endgame... |
Oh yeah for the endgame, sqlite change sounds good. |
@deepak1556 please take a look at b67f4cc. This should cover the reload scenario at least. Arguably I think it could happen as well when changing workspaces on an existing window but since no user complained so far, I suggest we do the real fix in Electron in July if possible. |
I pushed another change to also skip the sqlite init when loading a window that was loaded before, leaving this case to only warm up sqlite on the very first opening of a window. Deepak to investigate whether a fix in Electron:
Otherwise I suggest to close for now unless lots of others see this in their Electron use. |
With Electron 13 update and reverting the above sqlite workarounds, I am no longer able to repro the issue. Preload script is executing only after the IPC broker connection is reset. @bpasero I will leave this issue open incase you want to revert the sqlite workarounds otherwise feel free to close it. Thanks! |
Ben is on vacation, so moving this out to August so he can decide what to do in debt week. Nothing for endgame. |
I was not able to reproduce either after removing my workaround, thus going with it 👍 |
Testing #127195
On OS X Version 11.4
Reload window
The command hangs, you see a blank window and cannot open the developer tools (sry for the unhelpful screenshot)
![image](https://user-images.githubusercontent.com/172399/123783918-2ed1c600-d8d7-11eb-8c1e-f20134e72e70.png)
Closing the blank window and opening the vscode folder in a new window reconnects to the running process.
Repro behaviour:
@bpasero any suggestion for how to collect more diagnostic information when in this state?
The text was updated successfully, but these errors were encountered: