-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[RPC] Delay sending messages when there are handlers running initialization #13180
Conversation
047e404
to
5d35e32
Compare
* add an event to listen for init events on rpc proxy handler * eager initialize DOCUMENTS_EXT Proxy when EDITORS_AND_DOCUMENTS_EXT was initialized
* automate init by specifying required remote depednencies on set
* add other dependencies * make sure to not start initialization multiple times
20cce47
to
276b7e7
Compare
* don't throw error on possible race condition but log only * initialize dependencies before resolving promise
276b7e7
to
966d462
Compare
* revert previous approach
* pause communication during init of handlers * introduce init callback allowing to implement this blocking mechanism
* add debug logs
* remove debug logs again
* fix initial init promise state
@martin-fleck-at Could you please have another look? I've added an init callback that delays already initialized handlers from sending their messages immediately while an init is going on. As far as I could see, this should sync the messages/events as expected. |
@jfaltermeier Sure, I'll have another look at it tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good to me and I think it should properly sync messages during initialization phase. However, I do have a few challenges with the naming as I believe it makes it hard to understand what is happening. Please see inline comments for that.
* rename from init callback to proxy synchronizer * use rpc promise to report init done
88eb199
to
437d1cc
Compare
* rename from init callback to proxy synchronizer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What it does
With this PR
ClientProxyHandler
s will report their init state. When there is a running initialization, we delay sending messages on all handlers until this initialization is done.This should prevent cases where messages sent later via an already initialized handler can overtake earlier messages that are waiting for their handler's initialization to finish.
This will help avoiding race condition like in #13172
Fixes #13158
Fixes #13172
Commits should be squashed when closing the PR
How to test
Follow-ups
Review checklist
Reminder for reviewers