Skip to content

Commit 679bc0f

Browse files
committed
fix(cf-workers): disable retry on buckets to avoid WASM panic
see apache/arrow-rs-object-store#624
1 parent 1d61dfc commit 679bc0f

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

crates/cf-workers/src/backend.rs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use multistore::types::BucketConfig;
1616

1717
use object_store::list::PaginatedListStore;
1818
use object_store::signer::Signer;
19+
use object_store::RetryConfig;
1920
use std::sync::Arc;
2021
use worker::Fetch;
2122

@@ -99,12 +100,28 @@ impl ProxyBackend for WorkerBackend {
99100
&self,
100101
config: &BucketConfig,
101102
) -> Result<Box<dyn PaginatedListStore>, ProxyError> {
103+
// Disable retries: object_store's retry logic uses `tokio::time::sleep`
104+
// which panics on WASM (`std::time::Instant::now` is unsupported).
105+
// See: https://github.com/apache/arrow-rs-object-store/issues/624
106+
let no_retry = RetryConfig {
107+
max_retries: 0,
108+
..Default::default()
109+
};
102110
let builder = match create_builder(config)? {
103-
StoreBuilder::S3(s) => StoreBuilder::S3(s.with_http_connector(FetchConnector)),
111+
StoreBuilder::S3(s) => StoreBuilder::S3(
112+
s.with_http_connector(FetchConnector)
113+
.with_retry(no_retry),
114+
),
104115
#[cfg(feature = "azure")]
105-
StoreBuilder::Azure(a) => StoreBuilder::Azure(a.with_http_connector(FetchConnector)),
116+
StoreBuilder::Azure(a) => StoreBuilder::Azure(
117+
a.with_http_connector(FetchConnector)
118+
.with_retry(no_retry),
119+
),
106120
#[cfg(feature = "gcp")]
107-
StoreBuilder::Gcs(g) => StoreBuilder::Gcs(g.with_http_connector(FetchConnector)),
121+
StoreBuilder::Gcs(g) => StoreBuilder::Gcs(
122+
g.with_http_connector(FetchConnector)
123+
.with_retry(no_retry),
124+
),
108125
};
109126
builder.build()
110127
}

0 commit comments

Comments
 (0)