This is an automated email from the ASF dual-hosted git repository.
kou 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 7bc31d7d0a GH-51604: [C++][Parquet] Only link opentelemetry-cpp::sdk
on arrow_reader_writer_tracing_test.cc to avoid double freeing (#51606)
7bc31d7d0a is described below
commit 7bc31d7d0a5bf3ff776273c699194bf98210d703
Author: Raúl Cumplido <[email protected]>
AuthorDate: Mon Sep 28 23:05:34 2026 +0200
GH-51604: [C++][Parquet] Only link opentelemetry-cpp::sdk on
arrow_reader_writer_tracing_test.cc to avoid double freeing (#51606)
### Rationale for this change
ASAN and TSAN jobs were failing due to double freeing opentelemetry globals.
### What changes are included in this PR?
Avoid linking all OpenTelemetry libs and only link `opentelemetry-cpp::sdk`
to the test to avoid double free as OpenTelemetry is already linked in
libarrow. ) opentelemetry-cpp::sdk adds the required include directories and
compile definitions.
### Are these changes tested?
Yes on CI
### Are there any user-facing changes?
No
### Was AI used for this PR?
In accordance to the [AI generation
guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code),
please disclose below whether and how AI was used in this PR.
**PR code and description written by:**
- [x] Human
- [x] AI
Code was written by a human but I've used Claude Opus 5.5 in order to
analyze the problem and brainstorm solutions.
**Reviewed before submission by:**
- [x] Human
- [ ] AI
- [ ] Not reviewed
* GitHub Issue: #51604
Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/src/parquet/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpp/src/parquet/CMakeLists.txt b/cpp/src/parquet/CMakeLists.txt
index 59ac952652..077946e6cc 100644
--- a/cpp/src/parquet/CMakeLists.txt
+++ b/cpp/src/parquet/CMakeLists.txt
@@ -412,12 +412,12 @@ add_parquet_test(arrow-reader-writer-test
arrow/arrow_statistics_test.cc
arrow/variant_test.cc)
-if(ARROW_WITH_OPENTELEMETRY AND NOT ARROW_USE_ASAN)
+if(ARROW_WITH_OPENTELEMETRY)
add_parquet_test(arrow-reader-writer-tracing-test
SOURCES
arrow/arrow_reader_writer_tracing_test.cc
EXTRA_LINK_LIBS
- ${ARROW_OPENTELEMETRY_LIBS})
+ opentelemetry-cpp::sdk)
endif()
add_parquet_test(arrow-index-test SOURCES arrow/index_test.cc)