raulcd commented on PR #47627:
URL: https://github.com/apache/arrow/pull/47627#issuecomment-3341554580
> Nice! But since you catch the exception in the init handler, you can just
keep using `std::call_once`.
do you mean like this patch:
```diff
diff --git a/c++/src/Timezone.cc b/c++/src/Timezone.cc
index 384f8ea99..2d679fcd2 100644
--- a/c++/src/Timezone.cc
+++ b/c++/src/Timezone.cc
@@ -698,10 +698,15 @@ namespace orc {
mutable std::once_flag initialized_;
TimezoneImpl* getImpl() const {
- std::call_once(initialized_, [&]() {
- auto buffer = loadTZDB(filename_);
- impl_ = std::make_unique<TimezoneImpl>(filename_,
std::move(buffer));
- });
+ try {
+ std::call_once(initialized_, [&]() {
+ auto buffer = loadTZDB(filename_);
+ impl_ = std::make_unique<TimezoneImpl>(filename_,
std::move(buffer));
+ });
+ } catch (...) {
+ // If initialization failed, re-throw the exception
+ std::rethrow_exception(std::current_exception());
+ }
return impl_.get();
}
```
This does not raise the Exception and I still get the crash (and the test
failures).
--
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]