-
Notifications
You must be signed in to change notification settings - Fork 803
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
PVF: re-preparing artifact on failed runtime construction #3187
Changes from 9 commits
e409203
a2bd8de
3f3e132
b4c8361
30b3e8a
70cc13f
2e0f930
c1bd7bf
ac7d3d2
a10f16d
ef88ee5
ed77274
ab4f40c
5bf6daa
d722ccf
2a83c1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -40,6 +40,9 @@ pub enum WorkerResponse { | |||||||||
}, | ||||||||||
/// The candidate is invalid. | ||||||||||
InvalidCandidate(String), | ||||||||||
/// Instantiation of the WASM module instance failed during an execution. | ||||||||||
/// Possibly related to local issues or dirty node update. May be retried with re-preparation. | ||||||||||
RuntimeConstruction(String), | ||||||||||
/// The job timed out. | ||||||||||
JobTimedOut, | ||||||||||
/// The job process has died. We must kill the worker just in case. | ||||||||||
|
@@ -68,6 +71,9 @@ pub enum JobResponse { | |||||||||
/// The result of parachain validation. | ||||||||||
result_descriptor: ValidationResult, | ||||||||||
}, | ||||||||||
/// A possibly transient runtime instantion error happend during the execution; maybe retried | ||||||||||
/// with preparation | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad :) thank you! Fixed at a10f16d |
||||||||||
RuntimeConstruction(String), | ||||||||||
/// The candidate is invalid. | ||||||||||
InvalidCandidate(String), | ||||||||||
} | ||||||||||
|
@@ -81,6 +87,15 @@ impl JobResponse { | |||||||||
Self::InvalidCandidate(format!("{}: {}", ctx, msg)) | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
/// Creates a may retry response from a context `ctx` and a message `msg` (which can be empty). | ||||||||||
pub fn runtime_construction(ctx: &'static str, msg: &str) -> Self { | ||||||||||
if msg.is_empty() { | ||||||||||
Self::RuntimeConstruction(ctx.to_string()) | ||||||||||
} else { | ||||||||||
Self::RuntimeConstruction(format!("{}: {}", ctx, msg)) | ||||||||||
} | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
/// An unexpected error occurred in the execution job process. Because this comes from the job, | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,6 +238,14 @@ impl Artifacts { | |
.is_none()); | ||
} | ||
|
||
/// Remove artifact by its id. | ||
pub fn remove(&mut self, artifact_id: ArtifactId) -> Option<(ArtifactId, PathBuf)> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do I get it right, we don't currently remove anything from disk, either here or in the unused artifact pruning procedure? Are they always removed from the memory cache table only, and the disk is cleaned up only on node startup? It's totally okay for now, but we shouldn't forget that if we ever decide to re-enable artifact persistence. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, it seems like I indeed missed the moment when artifact names became really random, so right now, it's not a concern at all. Never mind. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, the logic of |
||
self.inner.remove(&artifact_id).and_then(|state| match state { | ||
ArtifactState::Prepared { path, .. } => Some((artifact_id, path)), | ||
_ => None, | ||
}) | ||
} | ||
|
||
/// Remove artifacts older than the given TTL and return id and path of the removed ones. | ||
pub fn prune(&mut self, artifact_ttl: Duration) -> Vec<(ArtifactId, PathBuf)> { | ||
let now = SystemTime::now(); | ||
|
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.
What do you think about
retry_immediately
? I would appreciate a brief comment on why we need itThere 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.
Sure, thank you! Fixed d722ccf