Skip to content

Commit

Permalink
Clarify documentation
Browse files Browse the repository at this point in the history
Co-authored-by: Arya <[email protected]>
  • Loading branch information
teor2345 and arya2 committed Nov 14, 2023
1 parent 6bdf6c1 commit 21b5c39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zebra-chain/src/diagnostic/task/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ where
{
type Output = T;

/// Panics if the thread panicked.
/// If `panic_on_unexpected_termination` is true, and Zebra is not shutting down, also panics
/// if the thread exits.
/// # Panics
///
/// - if the thread panicked.
/// - if the thread is cancelled, `panic_on_unexpected_termination` is true, and
/// Zebra is not shutting down.
///
/// Threads can't be cancelled except by using a panic, so there are no thread errors here.
/// `panic_on_unexpected_termination` is
Expand Down
2 changes: 2 additions & 0 deletions zebra-network/src/peer/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ impl Client {

let result = match self.heartbeat_task.poll_unpin(cx) {
Poll::Pending => {
// The heartbeat task returns `Pending` while it continues to run.
// But if it has dropped its receiver, it is shutting down, and we should also shut down.
if is_canceled {
self.set_task_exited_error(
"heartbeat",
Expand Down

0 comments on commit 21b5c39

Please sign in to comment.