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

csringhofer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 554cc2bbc IMPALA-14777: Sync dynamic_annotations from Kudu
554cc2bbc is described below

commit 554cc2bbccd932ea057440c9c0762b3522993d0c
Author: Marton Greber <[email protected]>
AuthorDate: Tue Feb 24 18:29:03 2026 +0100

    IMPALA-14777: Sync dynamic_annotations from Kudu
    
    be/src/gutil/dynamic_annotations.h was missing Kudu commit a964b0e36
    ("gutil: properly hook up ANNOTATE_HAPPENS_BEFORE/AFTER", Feb 2018),
    which fixed ANNOTATE_HAPPENS_BEFORE and ANNOTATE_HAPPENS_AFTER to use
    the proper AnnotateHappensBefore/AnnotateHappensAfter TSAN runtime
    functions instead of the condvar-based equivalents.
    
    Also adds the corresponding AnnotateHappensBefore/AnnotateHappensAfter
    stub implementations to dynamic_annotations.c, which were missing the
    non-TSAN fallback definitions needed when
    DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=0.
    
    Testing: data-stream-test was reporting a TSAN data race on
    SignalData::stack in debug-util.cc due to the annotations being
    effectively no-ops. Running the test under TSAN with this patch applied
    shows the race no longer appears.
    
    Change-Id: I70eda4515cb5e9aed835c371ed3b473e6a9c3ea6
    Reviewed-on: http://gerrit.cloudera.org:8080/24030
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 be/src/gutil/dynamic_annotations.c |  4 ++++
 be/src/gutil/dynamic_annotations.h | 12 +++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/be/src/gutil/dynamic_annotations.c 
b/be/src/gutil/dynamic_annotations.c
index 32c032b2a..5851b103e 100644
--- a/be/src/gutil/dynamic_annotations.c
+++ b/be/src/gutil/dynamic_annotations.c
@@ -84,6 +84,10 @@ void AnnotateCondVarSignal(const char *file, int line,
                            const volatile void *cv){}
 void AnnotateCondVarSignalAll(const char *file, int line,
                               const volatile void *cv){}
+void AnnotateHappensBefore(const char *file, int line,
+                           const volatile void *obj){}
+void AnnotateHappensAfter(const char *file, int line,
+                          const volatile void *obj){}
 void AnnotatePublishMemoryRange(const char *file, int line,
                                 const volatile void *address,
                                 long size){}
diff --git a/be/src/gutil/dynamic_annotations.h 
b/be/src/gutil/dynamic_annotations.h
index 81458e504..e326ff12f 100644
--- a/be/src/gutil/dynamic_annotations.h
+++ b/be/src/gutil/dynamic_annotations.h
@@ -121,8 +121,10 @@
     AnnotateCondVarSignalAll(__FILE__, __LINE__, cv)
 
   /* Annotations for user-defined synchronization mechanisms. */
-  #define ANNOTATE_HAPPENS_BEFORE(obj) ANNOTATE_CONDVAR_SIGNAL(obj)
-  #define ANNOTATE_HAPPENS_AFTER(obj)  ANNOTATE_CONDVAR_WAIT(obj)
+  #define ANNOTATE_HAPPENS_BEFORE(obj) \
+    AnnotateHappensBefore(__FILE__, __LINE__, obj)
+  #define ANNOTATE_HAPPENS_AFTER(obj) \
+    AnnotateHappensAfter(__FILE__, __LINE__, obj)
 
   /* Report that the bytes in the range [pointer, pointer+size) are about
      to be published safely. The race checker will create a happens-before
@@ -490,9 +492,13 @@ void AnnotateCondVarSignal(const char *file, int line,
                            const volatile void *cv);
 void AnnotateCondVarSignalAll(const char *file, int line,
                               const volatile void *cv);
+void AnnotateHappensBefore(const char *file, int line,
+                           const volatile void *obj);
+void AnnotateHappensAfter(const char *file, int line,
+                          const volatile void *obj);
 void AnnotatePublishMemoryRange(const char *file, int line,
                                 const volatile void *address,
-                                long size);
+                                long size); // NOLINT
 void AnnotateUnpublishMemoryRange(const char *file, int line,
                                   const volatile void *address,
                                   long size);

Reply via email to