-
Notifications
You must be signed in to change notification settings - Fork 28
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
rsc: Resolve Blobs on request #1502
Conversation
local_store: Option<String>, | ||
// Maps databse store uuid -> dyn blob::DebugBlobStore | ||
// that represent said store. | ||
async fn activate_stores( |
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.
This name is confusing. Should it just be called active_stores
? Activate to me implies its going to have a side effect but its just collecting data.
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.
This kind of ties in to the question below. Its not quite just collecting data, it also transforms the database model into the object responsible for doing things. The reason for "activate" was because we had to upgrade the data to a service to make it usable. Otherwise it would've just been called fetch or get.
One thing that may be important to note, this function will also be where other non-local stores are constructed/upgraded in the future
for store in stores.into_iter() { | ||
active_stores.insert( | ||
store.id, | ||
Arc::new(blob::LocalBlobStore { root: store.root }), |
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.
Why is this not just Arc::new(store)?
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.
LocalBloStore is a different type/"service provider"
The LocalBlobStore in the database is just tracking data needed to construct the "runtime" LocalBlobStore which actually implements the api/trait to upload/resolve/delete a blob
rust/rsc/src/rsc/read_job.rs
Outdated
|
||
let stderr_blob = match resolve_blob(matching_job.stderr_blob_id, txn, &blob_stores).await { | ||
Err(err) => { | ||
tracing::error! {%err, "Failed to resolve stderr blob. Resoving job as a cache miss."}; |
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.
FYI: You made a typo in "Resolving" in all of these error messages.
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.
LGTM
Blobs returned to the client via a matching jobs now resolve and return the URL where that blob can be downloaded from.
Example: