Skip to content

Commit

Permalink
cleanup and address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxa21 committed Jun 18, 2024
1 parent 1eb05f5 commit bd94c63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/object_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions src/object_store/src/object/opendal_engine/opendal_object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ impl ObjectStore for OpendalObjectStore {
ObjectError::internal("opendal streaming read error")
));
let range: Range<u64> = (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()
Expand Down Expand Up @@ -321,6 +326,11 @@ impl OpendalStreamingUploader {
media_type: &'static str,
) -> ObjectResult<Self> {
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(
Expand Down

0 comments on commit bd94c63

Please sign in to comment.