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

rpc module: fix race in subscription close callback #1098

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

niklasad1
Copy link
Member

It's technically possible that subscription future finishes after the subscription callback is executed (most likely just in tests) anyway this PR ensures that the subscription future completes before the subscription callback is terminated.

@niklasad1 niklasad1 requested a review from a team as a code owner April 25, 2023 16:16
Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

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

Looks good, and the code is easier to follow too :)


Response::Closed
let _ = pending.accept().await;
SubscriptionCloseResponse::None
Copy link
Member Author

Choose a reason for hiding this comment

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

flaky test, it shouldn't return anything such that it triggers a timeout..

@niklasad1 niklasad1 merged commit 8fee8c2 into master Apr 26, 2023
@niklasad1 niklasad1 deleted the na-rpc-module-close-race branch April 26, 2023 07:46
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