Skip to content

Commit

Permalink
Attempt to revert review change to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatia committed Jan 15, 2025
1 parent 395f6ba commit b98c536
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions tiledb/sm/query/readers/sparse_global_order_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -781,12 +781,6 @@ bool SparseGlobalOrderReader<BitmapType>::add_next_cell_to_queue(
// Try to find a new tile.
if (result_tiles_it[frag_idx] != result_tiles[frag_idx].end()) {
// Find a cell in the current result tile.

// This enforces all the coords unfiltering results to be available before
// taking the lock on tile_queue_mutex_. This is to avoid a deadlock where
// a lock is held forever while waiting for a result to be available,
// while the next scheduled task is deadlocking on that lock
rc.tile_->wait_all_coords();
rc = GlobalOrderResultCoords(&*result_tiles_it[frag_idx], 0);

// All tiles should at least have one cell available.
Expand Down Expand Up @@ -821,6 +815,12 @@ bool SparseGlobalOrderReader<BitmapType>::add_next_cell_to_queue(
return true;
}

// This enforces all the coords unfiltering results to be available before
// taking the lock on tile_queue_mutex_. This is to avoid a deadlock where a
// lock is held forever while waiting for a result to be available, while
// the next scheduled task is deadlocking on that lock
rc.tile_->wait_all_coords();

std::unique_lock<std::mutex> ul(tile_queue_mutex_);

// Add all the cells in this tile with the same coordinates as this cell
Expand Down Expand Up @@ -945,13 +945,6 @@ SparseGlobalOrderReader<BitmapType>::merge_result_cell_slabs(
read_state_.frag_idx()[f].cell_idx_ :
0;
GlobalOrderResultCoords rc(&*(rt_it[f]), cell_idx);
// This enforces all the coords unfiltering results to be available
// before taking the lock on tile_queue_mutex_. This is to avoid a
// deadlock where a lock is held forever while waiting for a result to
// be available, while the next scheduled task is deadlocking on that
// lock
rc.tile_->wait_all_coords();

bool res = add_next_cell_to_queue(
rc, rt_it, result_tiles, tile_queue, to_delete);
{
Expand Down

0 comments on commit b98c536

Please sign in to comment.