This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs-object-store.git
The following commit(s) were added to refs/heads/main by this push:
new 5c74363 Restore UnwindSafe/RefUnwindSafe on ClientOptions by bounding
DnsResolver (#836)
5c74363 is described below
commit 5c743637e97d2f3417b6fd54532bb1223c6547c1
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Aug 19 16:42:08 2026 -0400
Restore UnwindSafe/RefUnwindSafe on ClientOptions by bounding DnsResolver
(#836)
Add UnwindSafe + RefUnwindSafe as supertraits of DnsResolver so that
Arc<dyn DnsResolver> implements the auto traits, restoring them on
ClientOptions and the store builders that embed it.
Fixes #835
Co-authored-by: Claude Fable 5 <[email protected]>
---
src/client/dns.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/client/dns.rs b/src/client/dns.rs
index 7a4cc85..8dadee7 100644
--- a/src/client/dns.rs
+++ b/src/client/dns.rs
@@ -20,6 +20,7 @@
use std::fmt::Debug;
use std::future::Future;
use std::net::IpAddr;
+use std::panic::{RefUnwindSafe, UnwindSafe};
use std::pin::Pin;
/// Error returned by a [`DnsResolver`]
@@ -45,7 +46,9 @@ pub type DnsFuture = Pin<Box<dyn Future<Output =
Result<Vec<IpAddr>, DnsError>>
/// [`ClientOptions::with_dns_resolver`]:
crate::ClientOptions::with_dns_resolver
/// [`ClientOptions::dns_resolver`]: crate::ClientOptions::dns_resolver
/// [`HttpConnector`]: crate::client::HttpConnector
-pub trait DnsResolver: Debug + Send + Sync {
+// The `UnwindSafe` bounds preserve the auto traits of `ClientOptions`, which
+// stores an `Arc<dyn DnsResolver>`
+pub trait DnsResolver: Debug + Send + Sync + UnwindSafe + RefUnwindSafe {
/// Resolve `host` to one or more IP addresses
///
/// The returned addresses are tried in order until a connection succeeds,