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
fix: always use new site instance for a new navigation. #18860
fix: always use new site instance for a new navigation. #18860
Conversation
07cad8d
to
6c88fdd
Compare
Requesting feedback from @MarshallOfSound as this might be relevant to https://hackmd.io/rBd-NL4nTDWgv5GLISqu2g ? |
I see the issue, I would also suggest to make Can you check if there is a visiable time difference in loading a renderer with/without this change. Thanks! |
@ckerr, this is definitely relevant to the document you linked and I fully support the direction described in that document. This PR is just a small tweak in our current solution to remove the pain of node modules unexpectedly failing to load, while we move in the direction of context-aware node modules. |
@deepak1556 , doesn't your suggestion conflict with this comment?
|
Sorry I didn't write the comment clearly, it simply meant in non-sandboxed mode when the site instance is forced by us, try to maintain the same instance for a request over successive calls to this function so that the request won't be destroyed. It has nothing to do with candidate site instances. Those site instances are created by speculative render frame hosts which are pre spawned hosts maybe leftover from previous renderer sometimes, thats an optimization to reduce cold startup time. I was trying to use the same for our non-sandboxed renderers, but clearly that has led to this problem. My suggestion here is to completely eliminate the use of candidate site instances for non sandboxed renderers.
|
6c88fdd
to
0fb2988
Compare
@deepak1556 Makes sense, thanks for explaining. Modified the change so that candidate site instances are no longer considered. |
I'll be without internet access for 3 weeks starting tomorrow. If there's any interest in getting this merged earlier, please feel free to take ownership @deepak1556 , @miniak. Thanks. |
@deepak1556 Discarding the candidate site instance breaks some unit tests. Had to revert to the original fix.
|
4ba8a91
to
74364e0
Compare
@deepak1556 I've rebased it on latest master, resolved conflicts and fixed some clang-format issues. How do we get this integrated? |
74364e0
to
df26df4
Compare
df26df4
to
6f16886
Compare
Release Notes Persisted
|
I think we need manual backport for other suppoted release lines. |
A maintainer has manually backported this PR to "6-0-x", please check out #19826 |
A maintainer has manually backported this PR to "7-0-x", please check out #19827 |
A maintainer has manually backported this PR to "5-0-x", please check out #19828 |
In non-sandboxed renderers, always use a new site instance when starting a new navigation. This prevents the same process from being reused by consecutive navigations in the same frame if the subsequent navigation happens before the preload script for the first navigation finishes.
Fixes #17576.
Checklist
npm test
passesRelease Notes
Notes: Removed the possibility of a preload script being executed twice for the same process in quickly succeeding navigations in the same frame.