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

sync_state_dump test holds a lock across an await point #9650

Open
nagisa opened this issue Oct 6, 2023 · 0 comments
Open

sync_state_dump test holds a lock across an await point #9650

nagisa opened this issue Oct 6, 2023 · 0 comments
Labels
A-testing Area: Unit testing / integration testing C-housekeeping Category: Refactoring, cleanups, code quality

Comments

@nagisa
Copy link
Collaborator

nagisa commented Oct 6, 2023

if let Some(view_client2) = &*view_client2_holder.write().unwrap() {
match view_client2.send(GetBlock::latest().with_span_context()).await {

In this test

if let Some(view_client2) = &*view_client2_holder.write().unwrap() {

grabs a write lock, and then the test proceeds to immediately await afterwards. In Rust locks should not be held across await points as that’s a recipe for a deadlock if any other tasks need this same lock to make progress.

@nagisa nagisa added A-testing Area: Unit testing / integration testing C-housekeeping Category: Refactoring, cleanups, code quality labels Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing Area: Unit testing / integration testing C-housekeeping Category: Refactoring, cleanups, code quality
Projects
None yet
Development

No branches or pull requests

1 participant