availability-recovery: move cpu burners in blocking tasks (#7417)

* 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>
This commit is contained in:
Andrei Sandu
2023-07-04 12:50:49 +03:00
committed by GitHub
parent e53d15aa20
commit a0814490d2
5 changed files with 288 additions and 41 deletions
@@ -75,6 +75,9 @@ pub enum RecoveryError {
/// A requested chunk is unavailable.
Unavailable,
/// Erasure task channel closed, usually means node is shutting down.
ChannelClosed,
}
impl std::fmt::Display for RecoveryError {
@@ -82,6 +85,7 @@ impl std::fmt::Display for RecoveryError {
let msg = match self {
RecoveryError::Invalid => "Invalid",
RecoveryError::Unavailable => "Unavailable",
RecoveryError::ChannelClosed => "ChannelClosed",
};
write!(f, "{}", msg)