fix(overlaybd): probe p2p before remote runtime initialization - #172
Open
WindSongShaoGe wants to merge 1 commit into
Open
fix(overlaybd): probe p2p before remote runtime initialization#172WindSongShaoGe wants to merge 1 commit into
WindSongShaoGe wants to merge 1 commit into
Conversation
Contributor
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
| // Probe before the OnceCell captures this runtime. Otherwise a caller | ||
| // that reaches `remote_runtime` before `create_image_file` freezes an | ||
| // empty acceleration address into the first burst of remote reads. | ||
| self.enable_acceleration(); |
Contributor
There was a problem hiding this comment.
enable_acceleration() performs synchronous DNS resolution and TcpStream::connect_timeout calls (up to one second per resolved address). Calling it directly while initializing this async OnceCell can block a Tokio worker whenever any remote-open path first initializes the runtime, delaying unrelated tasks. Run the probe via tokio::task::spawn_blocking (or replace it with an async, bounded probe) before setting the registry address.
Suggestion:
Suggested change
| self.enable_acceleration(); | |
| let service = self.clone(); | |
| tokio::task::spawn_blocking(move || service.enable_acceleration()) | |
| .await | |
| .context("join acceleration probe task")?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
The remote runtime is stored in a
OnceCell. Previously, P2P acceleration was only probed fromcreate_image_file. If another call initialized the remote runtime first, the runtime permanently captured an empty acceleration address, so subsequent layer reads bypassed P2P acceleration.Validation
git diff --checkpassedRefs #138