Skip to content

Commit 446700a

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

File tree

6 files changed

+37
-23
lines changed

6 files changed

+37
-23
lines changed

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -1065,11 +1065,12 @@ 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
1070+
* architectures/build modes. SC-61065 to investigate why. } else { CHECK(20
1071+
* == loop_num->second);
1072+
* }
1073+
*/
10731074

10741075
// Try to read multiple frags without partial tile offset reading. Should
10751076
// 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

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

972+
// The current threadpool design does not allow for unfiltering to
973+
// happen in chunks using a parallel for within this async task as the
974+
// wait_all in the end of the parallel for can deadlock.
972975
for (uint64_t range_thread_idx = 0;
973976
range_thread_idx < num_range_threads;
974977
range_thread_idx++) {
@@ -998,6 +1001,9 @@ Status ReaderBase::unfilter_tiles(
9981001
continue;
9991002
}
10001003

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

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)