Skip to content
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

Unload While Loading #11270

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Unload While Loading #11270

wants to merge 2 commits into from

Conversation

Ashod
Copy link
Contributor

@Ashod Ashod commented Mar 5, 2025

wsd: handle disconnection while loading
When the client disconnects while we are
loading the document, we risk getting
in an invalid state.

When we get disconnected while loading,
we have logic to terminate the kit.
Unfortunately, we don't account for
the fact that the session isn't yet
removed from the container, and fail
to detect this case. Furtheremore,
we should stop the DocBroker poll,
which we didn't previously.

Also, we fix an invalid state transition:

wsd: avoid transitioning to LIVE from WAIT_DISCONNECT
wsd: avoid transitioning to LIVE from WAIT_DISCONNECT
In the event that we gave up on loading,
we should never change the state back to LIVE
once we are in WAIT_DISCONNECT.

This was caught with: WRN ToClient-002: Unusual race - attempts to
transition from SessionState::WAIT_DISCONNECT to SessionState::LIVE|
wsd/ClientSession.cpp:151

@Ashod Ashod changed the title private/ash/unload Unload While Loading Mar 5, 2025
@Ashod Ashod force-pushed the private/ash/unload branch from 52f285e to 241d73b Compare March 5, 2025 03:03
@Ashod Ashod requested a review from mmeeks March 5, 2025 03:04
Copy link
Contributor

@mmeeks mmeeks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very sensible - but we badly need to catch all of these corner cases which are easy to forget in future. Hopefully now we understand it it shouldn't be that hard to do.
I would like a C++ unit test for this - perhaps we need to add new hooks for that - can you prioritize that ? =)
Good work.

@Ashod Ashod force-pushed the private/ash/unload branch 2 times, most recently from 49de65c to 9ec6c4a Compare March 6, 2025 02:28
Ashod added 2 commits March 6, 2025 19:39
When the client disconnects while we are
loading the document, we risk getting
in an invalid state.

When we get disconnected while loading,
we have logic to terminate the kit.
Unfortunately, we don't account for
the fact that the session isn't yet
removed from the container, and fail
to detect this case. Furtheremore,
we should stop the DocBroker poll,
which we didn't previously.

Change-Id: I19290f6252e445202132f6a6a9aa1987183919cf
Signed-off-by: Ashod Nakashian <[email protected]>
In the event that we gave up on loading,
we should never change the state back to LIVE
once we are in WAIT_DISCONNECT.

This was caught with: WRN  ToClient-002: Unusual race - attempts to
transition from SessionState::WAIT_DISCONNECT to SessionState::LIVE|
wsd/ClientSession.cpp:151

Change-Id: I6ed5ca19586facb801d2169f7cf66ed443cef310
Signed-off-by: Ashod Nakashian <[email protected]>
@Ashod Ashod force-pushed the private/ash/unload branch from 9ec6c4a to 0c0cb8c Compare March 7, 2025 00:39
@Ashod Ashod closed this Mar 7, 2025
@Ashod Ashod reopened this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants