Skip to content

Commit 804b0bb

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 804b0bb

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

crates/cf-workers/src/backend.rs

Lines changed: 17 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,25 @@ 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) => {
112+
StoreBuilder::S3(s.with_http_connector(FetchConnector).with_retry(no_retry))
113+
}
104114
#[cfg(feature = "azure")]
105-
StoreBuilder::Azure(a) => StoreBuilder::Azure(a.with_http_connector(FetchConnector)),
115+
StoreBuilder::Azure(a) => {
116+
StoreBuilder::Azure(a.with_http_connector(FetchConnector).with_retry(no_retry))
117+
}
106118
#[cfg(feature = "gcp")]
107-
StoreBuilder::Gcs(g) => StoreBuilder::Gcs(g.with_http_connector(FetchConnector)),
119+
StoreBuilder::Gcs(g) => {
120+
StoreBuilder::Gcs(g.with_http_connector(FetchConnector).with_retry(no_retry))
121+
}
108122
};
109123
builder.build()
110124
}

0 commit comments

Comments
 (0)