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

Fix rebuild channel hang #1335

Merged
merged 2 commits into from
Mar 20, 2023
Merged

Fix rebuild channel hang #1335

merged 2 commits into from
Mar 20, 2023

Conversation

tiagolobocastro
Copy link
Contributor

@tiagolobocastro tiagolobocastro commented Mar 20, 2023

fix(rebuild): don't clone receiver channel

When creating a rebuild job we were reusing the same comms type which is used to do bi-dir
communication between the rebuild frontend and backend.
In some situations this could lead into blocking stats because the receiver channel was kept
alive by the frontend even after the frontend terminates.

Force closing the channel should in theory help but it seems the queue is not drained on close.
See: async-channel/issues/23

Instead, let's split the channels into two types meaning only the backend has the receiver side.

Signed-off-by: Tiago Castro [email protected]


fix(rebuild): set final rebuild stats

When rebuild completes, right before the nexus completes the rebuild callback it's possible
that we get a stats request and in such case we have no stats to give.
To address this, then the rebuild backend completes it now sets the final rebuild stats in
the states, which will allow the stats to be retrieved.

Signed-off-by: Tiago Castro [email protected]

When creating a rebuild job we were reusing the same comms type which is used to do bi-dir
communication between the rebuild frontend and backend.
In some situations this could lead into blocking stats because the receiver channel was kept
alive by the frontend even after the frontend terminates.

Force closing the channel should in theory help but it seems the queue is not drained on close.
See: async-channel/issues/23

Instead, let's split the channels into two types meaning only the backend has the receiver side.

Signed-off-by: Tiago Castro <[email protected]>
When rebuild completes, right before the nexus completes the rebuild callback it's possible
that we get a stats request and in such case we have no stats to give.
To address this, then the rebuild backend completes it now sets the final rebuild stats in
the states, which will allow the stats to be retrieved.

Signed-off-by: Tiago Castro <[email protected]>
@tiagolobocastro
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Mar 20, 2023

Build succeeded:

@bors bors bot merged commit 92a23f6 into develop Mar 20, 2023
@bors bors bot deleted the rebuild-chan branch March 20, 2023 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants