You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ap...@apache.org on 2023/06/06 08:16:40 UTC

[arrow] branch main updated: GH-35868: [C++] Occasional TSAN failure on asof-join-node-test (#35904)

This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new c253625388 GH-35868: [C++] Occasional TSAN failure on asof-join-node-test (#35904)
c253625388 is described below

commit c2536253885eff81f258ccaa3a6834dce0bf192c
Author: rtpsw <rt...@hotmail.com>
AuthorDate: Tue Jun 6 11:16:28 2023 +0300

    GH-35868: [C++] Occasional TSAN failure on asof-join-node-test (#35904)
    
    ### 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 <rt...@hotmail.com>
    Signed-off-by: Antoine Pitrou <an...@python.org>
---
 cpp/src/arrow/acero/asof_join_node.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpp/src/arrow/acero/asof_join_node.cc b/cpp/src/arrow/acero/asof_join_node.cc
index b92339b951..f8dee5aac8 100644
--- a/cpp/src/arrow/acero/asof_join_node.cc
+++ b/cpp/src/arrow/acero/asof_join_node.cc
@@ -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_;