Skip to content

Commit

Permalink
pvf runtime construction error handling during execution: review comm…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
maksimryndin committed Feb 12, 2024
1 parent ac7d3d2 commit a10f16d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions polkadot/node/core/pvf/common/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ 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
/// A possibly transient runtime instantiation error happened during the execution; may be retried
/// with re-preparation
RuntimeConstruction(String),
/// The candidate is invalid.
InvalidCandidate(String),
Expand Down
12 changes: 9 additions & 3 deletions polkadot/node/core/pvf/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,15 @@ async fn handle_artifact_removal(
artifact_id: ArtifactId,
reply_to: oneshot::Sender<()>,
) -> Result<(), Fatal> {
let (artifact_id, path) = artifacts
.remove(artifact_id)
.expect("artifact sent by the execute queue for removal exists; qed");
let (artifact_id, path) = if let Some(artifact) = artifacts.remove(artifact_id) {
artifact
} else {
// if we haven't found the artifact by its id,
// it has been probably removed
// anyway with the randomness of the artifact name
// it is safe to ignore
return Ok(());
};
reply_to
.send(())
.expect("the execute queue waits for the artifact remove confirmation; qed");
Expand Down

0 comments on commit a10f16d

Please sign in to comment.