Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
availability-recovery: move cpu burners in blocking tasks (#7417)
Browse files Browse the repository at this point in the history
* Move expensive computations to blocking thread

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fix test

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* add internal error and fix dependent subystems

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fmt

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fix test fix

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* minor refactor and TODOs

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Impl Feedback for Review

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* review feedback

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* More docs

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* add some example timings in comments

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
  • Loading branch information
sandreim committed Jul 4, 2023
1 parent 39b35b4 commit 7e1e635
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 41 deletions.
11 changes: 11 additions & 0 deletions node/core/approval-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2519,6 +2519,17 @@ async fn launch_approval<Context>(
// do nothing. we'll just be a no-show and that'll cause others to rise up.
metrics_guard.take().on_approval_unavailable();
},
&RecoveryError::ChannelClosed => {
gum::warn!(
target: LOG_TARGET,
?para_id,
?candidate_hash,
"Channel closed while recovering data for candidate {:?}",
(candidate_hash, candidate.descriptor.para_id),
);
// do nothing. we'll just be a no-show and that'll cause others to rise up.
metrics_guard.take().on_approval_unavailable();
},
&RecoveryError::Invalid => {
gum::warn!(
target: LOG_TARGET,
Expand Down
2 changes: 1 addition & 1 deletion node/core/dispute-coordinator/src/participation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ async fn participate(
send_result(&mut result_sender, req, ParticipationOutcome::Invalid).await;
return
},
Ok(Err(RecoveryError::Unavailable)) => {
Ok(Err(RecoveryError::Unavailable)) | Ok(Err(RecoveryError::ChannelClosed)) => {
send_result(&mut result_sender, req, ParticipationOutcome::Unavailable).await;
return
},
Expand Down
Loading

0 comments on commit 7e1e635

Please sign in to comment.