Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/chasers/chaser_confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ bool chaser_confirm::handle_event(const code&, chase event_,
return false;

// Stop generating query during suspension.
// Incoming events may already be flushed to the strand at this point.
if (suspended())
return true;

Expand Down Expand Up @@ -132,13 +133,17 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
void chaser_confirm::do_bumped(height_t) NOEXCEPT
{
BC_ASSERT(stranded());
const auto& query = archive();

if (closed())
return;

// Stop while suspended as iteration is O(N^2) if blocks not organized.
if (suspended())
return;

// Guarded by candidate interlock.
size_t fork_point{};
const auto& query = archive();
auto fork = query.get_validated_fork(fork_point, checkpoint(), filter_);

// Fork may be empty if candidates were reorganized.
Expand Down Expand Up @@ -221,6 +226,7 @@ void chaser_confirm::organize(header_states& fork, const header_links& popped,
auto& query = archive();
auto height = add1(fork_point);

// Continue when suspended as write error terminates synchronous loop.
for (const auto& state: fork)
{
switch (state.ec.value())
Expand All @@ -238,6 +244,7 @@ void chaser_confirm::organize(header_states& fork, const header_links& popped,
}
case database::error::block_valid:
{
// False always sets a store fault (including for disk full).
if (!confirm_block(state.link, height, popped, fork_point))
return;

Expand Down
1 change: 1 addition & 0 deletions src/chasers/chaser_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ bool chaser_snapshot::handle_event(const code&, chase event_,
return false;

// Stop generating query during suspension.
// Incoming events may already be flushed to the strand at this point.
if (suspended())
return true;

Expand Down
1 change: 1 addition & 0 deletions src/chasers/chaser_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ bool chaser_template::handle_event(const code&, chase event_,
return false;

// Stop generating query during suspension.
// Incoming events may already be flushed to the strand at this point.
if (suspended())
return true;

Expand Down
1 change: 1 addition & 0 deletions src/chasers/chaser_transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ bool chaser_transaction::handle_event(const code&, chase event_,

// TODO: allow required messages.
////// Stop generating query during suspension.
////// Incoming events may already be flushed to the strand at this point.
////if (suspended())
//// return true;

Expand Down
2 changes: 2 additions & 0 deletions src/chasers/chaser_validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ bool chaser_validate::handle_event(const code&, chase event_,
return false;

// Stop generating query during suspension.
// Incoming events may already be flushed to the strand at this point.
if (suspended())
return true;

Expand Down Expand Up @@ -161,6 +162,7 @@ void chaser_validate::do_bumped(height_t height) NOEXCEPT
const auto& query = archive();

// Bypass until next event if validation backlog is full.
// Stop when suspended as write error des not terminate asynchronous loop.
while ((backlog_ < maximum_backlog_) && !closed() && !suspended())
{
const auto link = query.to_candidate(height);
Expand Down
1 change: 1 addition & 0 deletions src/full_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ void full_node::fault(const code& ec) NOEXCEPT
LOGF("Node fault, " << ec.message());
}

// If a call does not get all of the channels, subsequent failures do so.
suspend(ec);
}

Expand Down
Loading