-
Notifications
You must be signed in to change notification settings - Fork 439
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
calculate_logical_size: no longer use spawn_blocking #3664
Conversation
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.
Yeah, this is clearly the right thing to do.
I do wonder about the issue mentioned in the comment that this removes, though:
// Run in a separate thread since this can do a lot of
// synchronous file IO without .await inbetween
// if there are no RemoteLayers that would require downloading.
That's still a valid concern, right? I guess it's a more general issue that we use blocking I/O on files, and we don't need to specifically care about it here.
This is an issue still yes, more like #2975, but we created a deadlock with the |
this fixes a bug which exhausted the spawn_blocking pool which hung up the blocking io operations needed by download remote layer, because these threads used block_on.
7105485
to
d0238e2
Compare
Yay, first non-transient pass of |
Calculation of logical size is now async because of layer downloads, so we shouldn't use spawn_blocking for it. Use of `spawn_blocking` exhausted resources which are needed by `tokio::io::copy` when copying from a stream to a file which lead to deadlock. Fixes: #3657
Calculation of logical size is now async because of layer downloads, so we shouldn't use spawn_blocking for it. Use of
spawn_blocking
exhausted resources which are needed bytokio::io::copy
when copying from a stream to a file which lead to deadlock.Fixes: #3657