From b98c536956c352821a95de00d1087ebc5f86ea4a Mon Sep 17 00:00:00 2001 From: Ypatia Tsavliri Date: Wed, 15 Jan 2025 14:26:20 +0200 Subject: [PATCH] Attempt to revert review change to fix CI --- .../readers/sparse_global_order_reader.cc | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tiledb/sm/query/readers/sparse_global_order_reader.cc b/tiledb/sm/query/readers/sparse_global_order_reader.cc index 3a4b763bc6c..2204c631b90 100644 --- a/tiledb/sm/query/readers/sparse_global_order_reader.cc +++ b/tiledb/sm/query/readers/sparse_global_order_reader.cc @@ -781,12 +781,6 @@ bool SparseGlobalOrderReader::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. @@ -821,6 +815,12 @@ bool SparseGlobalOrderReader::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 ul(tile_queue_mutex_); // Add all the cells in this tile with the same coordinates as this cell @@ -945,13 +945,6 @@ SparseGlobalOrderReader::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); {