Skip to content

Commit

Permalink
ARROW-16964: [C++] TSAN error in asof-join-node tests (apache#13639)
Browse files Browse the repository at this point in the history
Converted `total_batches_` and `batches_processed_` to atomic variables since they are accessed simultaneously by the input received and process threads.  This was leading to a TSAN failure as described in the JIRA.

Authored-by: Weston Pace <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
  • Loading branch information
westonpace authored Jul 19, 2022
1 parent 3a5284f commit 97fb0d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/src/arrow/compute/exec/asof_join_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ class InputState {
// Schema associated with the input
std::shared_ptr<Schema> schema_;
// Total number of batches (only int because InputFinished uses int)
int total_batches_ = -1;
std::atomic<int> total_batches_{-1};
// Number of batches processed so far (only int because InputFinished uses int)
int batches_processed_ = 0;
std::atomic<int> batches_processed_{0};
// Index of the time col
col_index_t time_col_index_;
// Index of the key col
Expand Down

0 comments on commit 97fb0d5

Please sign in to comment.