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
5 changes: 4 additions & 1 deletion src/chasers/chaser_confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void chaser_confirm::reorganize(header_states& fork, size_t top,
const auto& query = archive();
header_links popped{};

while (top > fork_point)
while (top > fork_point && !closed())
{
const auto link = query.to_confirmed(top);
if (link.is_terminal())
Expand Down Expand Up @@ -223,6 +223,9 @@ void chaser_confirm::organize(header_states& fork, const header_links& popped,
// Continue when suspended as write error terminates synchronous loop.
for (const auto& state: fork)
{
if (closed())
return;

switch (state.ec.value())
{
case database::error::bypassed:
Expand Down
1 change: 1 addition & 0 deletions src/chasers/chaser_validate_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ bool chaser_validate::mark_valids(bool startup) NOEXCEPT
std::atomic_bool fault{};
constexpr auto parallel = poolstl::execution::par;

// Allow valids to drain when closed.
std::for_each(parallel, batched_.cbegin(), batched_.cend(),
[&](auto link) NOEXCEPT
{
Expand Down
Loading