diff --git a/src/object_store/Cargo.toml b/src/object_store/Cargo.toml index dbb41f1e931d..4fee5f953df5 100644 --- a/src/object_store/Cargo.toml +++ b/src/object_store/Cargo.toml @@ -32,7 +32,6 @@ hyper-tls = "0.5.0" itertools = { workspace = true } madsim = "0.2.27" opendal = { version = "0.47", features = [ -# opendal = { git = "https://github.com/apache/opendal", rev = "babbfe227f5a8287b113a02874e6931769659ad2", features = [ "executors-tokio", "services-azblob", "services-fs", diff --git a/src/object_store/src/object/opendal_engine/opendal_object_store.rs b/src/object_store/src/object/opendal_engine/opendal_object_store.rs index 5c23e67b2631..ebf7251d424a 100644 --- a/src/object_store/src/object/opendal_engine/opendal_object_store.rs +++ b/src/object_store/src/object/opendal_engine/opendal_object_store.rs @@ -150,6 +150,11 @@ impl ObjectStore for OpendalObjectStore { ObjectError::internal("opendal streaming read error") )); let range: Range = (range.start as u64)..(range.end as u64); + + // The layer specified first will be executed first. + // `TimeoutLayer` must be specified before `RetryLayer`. + // Otherwise, it will lead to bad state inside OpenDAL and panic. + // See https://docs.rs/opendal/latest/opendal/layers/struct.RetryLayer.html#panics let reader = self .op .clone() @@ -321,6 +326,11 @@ impl OpendalStreamingUploader { media_type: &'static str, ) -> ObjectResult { let monitored_execute = OpendalStreamingUploaderExecute::new(metrics, media_type); + + // The layer specified first will be executed first. + // `TimeoutLayer` must be specified before `RetryLayer`. + // Otherwise, it will lead to bad state inside OpenDAL and panic. + // See https://docs.rs/opendal/latest/opendal/layers/struct.RetryLayer.html#panics let writer = op .clone() .layer(TimeoutLayer::new().with_io_timeout(Duration::from_millis(