dmitry-chirkov-dremio commented on code in PR #51665:
URL: https://github.com/apache/arrow/pull/51665#discussion_r4213093917


##########
cpp/src/gandiva/tests/concurrent_make_test.cc:
##########
@@ -0,0 +1,212 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Regression tests for GH-601: concurrent Projector::Make()/Filter::Make() 
calls for the
+// *same* expression cache key.
+//
+// Before the fix, Make() read the shared object cache once to decide 
`is_cached`, then
+// SetLLVMObjectCache() performed a second, independent read of the same key. 
A thread
+// that saw a miss on the first read and a hit on the second one would both 
pre-load the
+// cached object (defining e.g. "expr_0_0" in its JITDylib) *and* add its own 
freshly
+// compiled IR module defining the same symbol, so LLVM ORC's duplicate-symbol 
detection
+// fired and Make() returned "Failed to add IR module to LLJIT: Duplicate 
definition of
+// symbol".
+//
+
+#include <gtest/gtest.h>
+
+#include <condition_variable>
+#include <memory>
+#include <mutex>
+#include <string>
+#include <thread>
+#include <vector>
+
+#include "arrow/memory_pool.h"
+#include "gandiva/filter.h"
+#include "gandiva/projector.h"
+#include "gandiva/tests/test_util.h"
+#include "gandiva/tree_expr_builder.h"
+
+namespace gandiva {

Review Comment:
   What is the runtime of this test? Have you observed any flakiness?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to