Skip to content

Commit ed9b334

Browse files
committed
Some more PR cleanup
1 parent 0a97612 commit ed9b334

File tree

6 files changed

+34
-23
lines changed

6 files changed

+34
-23
lines changed

test/src/unit-sparse-unordered-with-dups-reader.cc

+7-5
Original file line numberDiff line numberDiff line change
@@ -1065,11 +1065,13 @@ TEST_CASE_METHOD(
10651065
if (one_frag) {
10661066
CHECK(1 == loop_num->second);
10671067
}
1068-
1069-
// FIXME: This check has become unpredictable, see why the loop number is
1070-
// not consistent } else {
1071-
// CHECK(20 == loop_num->second);
1072-
// }
1068+
/**
1069+
* FIXME: The loop_num appears to be different on different architectures/build modes.
1070+
* SC-61065 to investigate why.
1071+
* } else {
1072+
* CHECK(20 == loop_num->second);
1073+
* }
1074+
*/
10731075

10741076
// Try to read multiple frags without partial tile offset reading. Should
10751077
// fail

tiledb/sm/query/readers/filtered_data.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ class FilteredData {
415415
auto timer_se = stats_->start_timer("read");
416416
return resources_.vfs().read(uri, offset, data, size, false);
417417
});
418-
// This should be changes once we use taskgraphs for modeling the data flow
418+
// This should be changed once we use taskgraphs for modeling the data flow
419419
block.set_io_task(task);
420420
}
421421

tiledb/sm/query/readers/reader_base.cc

+2
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,7 @@ Status ReaderBase::unfilter_tiles(
969969
return Status::Ok();
970970
}
971971

972+
// The current threadpool design does not allow for unfiltering to happen in chunks using a parallel for within this async task as the wait_all in the end of the parallel for can deadlock.
972973
for (uint64_t range_thread_idx = 0;
973974
range_thread_idx < num_range_threads;
974975
range_thread_idx++) {
@@ -998,6 +999,7 @@ Status ReaderBase::unfilter_tiles(
998999
continue;
9991000
}
10001001

1002+
// Unfiltering tasks have been launched, set the tasks to wait for in the corresponding tiles. When those tasks(futures) will be ready the tile processing that depends on the unfiltered tile will get unblocked.
10011003
auto tile_tuple = result_tile->tile_tuple(name);
10021004
tile_tuple->fixed_tile().set_unfilter_data_compute_task(task);
10031005

tiledb/sm/query/readers/result_tile.h

+14-11
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,20 @@ class ResultTile {
228228
}
229229

230230
~TileData() {
231-
// TODO: destructor should not throw, catch any exceptions
232-
if (fixed_filtered_data_task_.valid()) {
233-
auto st = fixed_filtered_data_task_.wait();
234-
}
235-
236-
if (var_filtered_data_task_.valid()) {
237-
auto st = var_filtered_data_task_.wait();
238-
}
239-
240-
if (validity_filtered_data_task_.valid()) {
241-
auto st = validity_filtered_data_task_.wait();
231+
try {
232+
if (fixed_filtered_data_task_.valid()) {
233+
auto st = fixed_filtered_data_task_.wait();
234+
}
235+
236+
if (var_filtered_data_task_.valid()) {
237+
auto st = var_filtered_data_task_.wait();
238+
}
239+
240+
if (validity_filtered_data_task_.valid()) {
241+
auto st = validity_filtered_data_task_.wait();
242+
}
243+
} catch (...) {
244+
return;
242245
}
243246
}
244247

tiledb/sm/tile/tile.cc

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#include "tiledb/sm/tile/tile.h"
3434

35-
#include <utility>
3635
#include "tiledb/common/exception/exception.h"
3736
#include "tiledb/common/heap_memory.h"
3837
#include "tiledb/common/memory_tracker.h"

tiledb/sm/tile/tile.h

+10-5
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ class TileBase {
107107
return static_cast<T*>(data());
108108
}
109109

110-
/** Converts the data pointer to a specific type with no check on compute
110+
/**
111+
* Converts the data pointer to a specific type with no check on compute
111112
* task. This is used for getting thte data from inside the compute thread
112-
* itself for unfiltering. */
113+
* itself for unfiltering.
114+
*/
113115
template <class T>
114116
inline T* data_as_unsafe() const {
115117
return static_cast<T*>(data_unsafe());
@@ -134,8 +136,10 @@ class TileBase {
134136
return data_.get();
135137
}
136138

137-
/** Returns the internal buffer. This is used for getting thte data from
138-
* inside the compute thread itself for unfiltering. */
139+
/**
140+
* Returns the internal buffer. This is used for getting thte data from
141+
* inside the compute thread itself for unfiltering.
142+
*/
139143
inline void* data_unsafe() const {
140144
return data_.get();
141145
}
@@ -198,7 +202,8 @@ class TileBase {
198202
/** The tile data type. */
199203
Datatype type_;
200204

201-
/** Whether to block waiting for io data to be ready before accessing data()
205+
/**
206+
* Whether to block waiting for io data to be ready before accessing data()
202207
*/
203208
const bool skip_waiting_on_io_task_;
204209

0 commit comments

Comments
 (0)