Background read-only region creation#1919
Merged
Merged
Conversation
When the Crucible Agent is requested to create a read-only region from a remote Downstairs source, this currently blocks the worker thread as region creation is performed in the worker loop, and it cannot respond to other state changes. This commit spawns region creation threads that the main worker thread can send requests to, and sends all read-only region creation requests there. This builds on the previous work to separate the serialized on-disk types from the in-memory types: a `Creating` state is added to the in-memory type and used while this background creation is occurring.
leftwo
reviewed
Apr 10, 2026
Contributor
leftwo
left a comment
There was a problem hiding this comment.
Thanks for the work here, I have some questions for you.
| let log0 = log.new(o!("component" => "worker")); | ||
| let df0 = Arc::clone(&df); | ||
| std::thread::spawn(|| { | ||
| tokio::spawn(async { |
Contributor
There was a problem hiding this comment.
If we are going from a real thread to a tokio task, could a long running region create trip us up here? The old way was with a thread which seemed like it could go off and do whatever for an hour and the rest of the agent could continue working. Do we run any risk of that here?
Contributor
Author
There was a problem hiding this comment.
I'm not sure about all the differences between threads and tasks, but I don't think there's a risk. With worker running in a thread or with a task, the read/write region creation occurs separately from the dropshot server and datafile manipulation logic.
leftwo
approved these changes
Apr 14, 2026
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.
When the Crucible Agent is requested to create a read-only region from a remote Downstairs source, this currently blocks the worker thread as region creation is performed in the worker loop, and it cannot respond to other state changes.
This commit spawns region creation threads that the main worker thread can send requests to, and sends all read-only region creation requests there.
This builds on the previous work to separate the serialized on-disk types from the in-memory types: a
Creatingstate is added to the in-memory type and used while this background creation is occurring.