Skip to content

Commit

Permalink
GH-35868: [C++] Occasional TSAN failure on asof-join-node-test (#35904)
Browse files Browse the repository at this point in the history
### Rationale for this change

`AsofJoinNode` may run into a data race when invalidating the key hasher.

The key hasher queried from one thread but invalidated from another. This might be simplified so that the key hasher would only be used from one thread, but this is out of scope for this PR.

### What changes are included in this PR?

The invalidated member of the key hasher is made atomic.

### Are these changes tested?

Yes, by existing testing.

### Are there any user-facing changes?

No.
* Closes: #35868

Authored-by: Yaron Gvili <rtpsw@hotmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
rtpsw committed Jun 6, 2023
1 parent e2ae492 commit c253625
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/arrow/acero/asof_join_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ class KeyHasher {
size_t index_;
std::vector<col_index_t> indices_;
std::vector<KeyColumnMetadata> metadata_;
const RecordBatch* batch_;
std::atomic<const RecordBatch*> batch_;
std::vector<HashType> hashes_;
LightContext ctx_;
std::vector<KeyColumnArray> column_arrays_;
Expand Down

0 comments on commit c253625

Please sign in to comment.