Skip to content

Commit

Permalink
Check validity of query_future_
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Dec 5, 2023
1 parent 7e0961e commit bca4b2b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libtiledbsoma/src/soma/managed_query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ ManagedQuery::ManagedQuery(
void ManagedQuery::close() {
if (query_future_.valid()) {
query_future_.wait();
} else {
throw TileDBSOMAError(
fmt::format("[ManagedQuery] [{}] 'query_future_' invalid", name_));
}
array_->close();
}
Expand Down Expand Up @@ -166,8 +169,13 @@ std::shared_ptr<ArrayBuffers> ManagedQuery::results() {
return buffers_;
}

LOG_DEBUG(fmt::format("[ManagedQuery] [{}] Waiting for query", name_));
query_future_.wait();
if (query_future_.valid()) {
LOG_DEBUG(fmt::format("[ManagedQuery] [{}] Waiting for query", name_));
query_future_.wait();
} else {
throw TileDBSOMAError(
fmt::format("[ManagedQuery] [{}] 'query_future_' invalid", name_));
}

auto status = query_->query_status();

Expand Down

0 comments on commit bca4b2b

Please sign in to comment.