-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix potential loss of room events during join #34819
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
Conversation
bdach
left a comment
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.
probably fine. @peppy not sure if you want to go over this
| return tcs.Task; | ||
| } | ||
|
|
||
| private void handleRoomRequest(Action request) |
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.
The previous code has forceSchedule = false while the new flow doesn't, can one of you two confirm this is known and expected?
Re-reviewing this as a whole seems like it may take a bit of time so I'd rather just confirm this-is-okay and go with it.
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.
Earliest reference I can find is #11316. At the time the join/leave task chain didn't exist and the scheduler was relied on as an ordering mechanism, so I don't think there's much purpose to the forceSchedule these days.
peppy
left a comment
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.
Let's get it on tachyon
Split out from #34815
As I mentioned internally, during
JoinRoomthere's a small window where events could be coming in and fail theRoom != nullcheck because we're busy doing a few more operations, such as looking up online users.This turns out to be more of a problem with matchmaking because all users are joined to the room simultaneously, but it can also happen in a standard multiplayer match and lead a desynchronised state.
The change here can only be classified as a hacky workaround. We'll need to do this better in the future, likely by reworking the room join process in the first place.