Xuanwo commented on PR #5807:
URL: https://github.com/apache/opendal/pull/5807#issuecomment-2735115963
Hi, I tested this PR locally and found that `test_read_range` can failed in
some cases, happen about 1/4 times:
```rust
---- behavior::test_read_range ----
test panicked: attempt to subtract with overflow
failures:
behavior::test_read_range
thread '<unnamed>' panicked at src/raw/http_util/bytes_range.rs:81:36:
attempt to subtract with overflow
stack backtrace:
0: rust_begin_unwind
at
/rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:692:5
1: core::panicking::panic_fmt
at
/rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:75:14
2: core::panicking::panic_const::panic_const_sub_overflow
at
/rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:178:21
3: opendal::raw::http_util::bytes_range::BytesRange::advance::{{closure}}
at ./src/raw/http_util/bytes_range.rs:81:36
4: core::option::Option<T>::map
at
/home/xuanwo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:1119:29
5: opendal::raw::http_util::bytes_range::BytesRange::advance
at ./src/raw/http_util/bytes_range.rs:81:18
6: <opendal::layers::retry::RetryReader<A,<A as
opendal::raw::accessor::Access>::Reader> as
opendal::raw::oio::read::api::Read>::read::{{closure}}
at ./src/layers/retry.rs:505:21
7: <opendal::layers::retry::RetryWrapper<R,I> as
opendal::raw::oio::read::api::Read>::read::{{closure}}::{{closure}}::{{closure}}
at ./src/layers/retry.rs:567:36
8:
<backon::retry_with_context::RetryWithContext<B,T,E,Ctx,Fut,FutureFn,SF,RF,NF>
as core::future::future::Future>::poll
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/backon-1.4.0/src/retry_with_context.rs:327:45
9: <opendal::layers::retry::RetryWrapper<R,I> as
opendal::raw::oio::read::api::Read>::read::{{closure}}
at ./src/layers/retry.rs:576:10
10: <core::pin::Pin<P> as core::future::future::Future>::poll
at
/home/xuanwo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/future.rs:124:9
11: <alloc::boxed::Box<T> as
opendal::raw::oio::read::api::Read>::read::{{closure}}
at ./src/raw/oio/read/api.rs:113:37
12: <opendal::types::read::buffer_stream::StreamingReader as
opendal::raw::oio::read::api::Read>::read::{{closure}}
at ./src/types/read/buffer_stream.rs:62:32
13: <opendal::raw::enum_utils::TwoWays<ONE,TWO> as
opendal::raw::oio::read::api::Read>::read::{{closure}}
at ./src/raw/enum_utils.rs:57:41
14: <opendal::types::read::buffer_stream::BufferStream as
futures_core::stream::Stream>::poll_next::{{closure}}
at ./src/types/read/buffer_stream.rs:197:49
15: <opendal::types::read::buffer_stream::BufferStream as
futures_core::stream::Stream>::poll_next
at ./src/types/read/buffer_stream.rs:204:48
16: <S as futures_core::stream::TryStream>::try_poll_next
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/futures-core-0.3.31/src/stream.rs:206:9
17: <futures_util::stream::try_stream::try_collect::TryCollect<St,C> as
core::future::future::Future>::poll
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/futures-util-0.3.31/src/stream/try_stream/try_collect.rs:46:26
18: opendal::types::read::reader::Reader::read::{{closure}}
at ./src/types/read/reader.rs:113:81
19:
opendal::types::operator::operator::Operator::read_with::{{closure}}::{{closure}}
at ./src/types/operator/operator.rs:606:52
20: behavior::async_read::test_read_range::{{closure}}
at ./tests/behavior/async_read.rs:106:10
21: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.42.0/src/runtime/park.rs:281:63
22: tokio::runtime::coop::with_budget
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.42.0/src/runtime/coop.rs:107:5
23: tokio::runtime::coop::budget
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.42.0/src/runtime/coop.rs:73:5
24: tokio::runtime::park::CachedParkThread::block_on
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.42.0/src/runtime/park.rs:281:31
25: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.42.0/src/runtime/context/blocking.rs:66:9
26: tokio::runtime::handle::Handle::block_on_inner::{{closure}}
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.42.0/src/runtime/handle.rs:327:13
27: tokio::runtime::context::runtime::enter_runtime
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.42.0/src/runtime/context/runtime.rs:65:16
28: tokio::runtime::handle::Handle::block_on_inner
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.42.0/src/runtime/handle.rs:326:9
29: tokio::runtime::handle::Handle::block_on
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.42.0/src/runtime/handle.rs:305:13
30: behavior::utils::build_async_trial::{{closure}}
at ./tests/behavior/utils.rs:71:9
31: libtest_mimic::Trial::test::{{closure}}
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libtest-mimic-0.8.1/src/lib.rs:119:54
32: core::ops::function::FnOnce::call_once{{vtable.shim}}
at
/home/xuanwo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
33: <alloc::boxed::Box<F,A> as
core::ops::function::FnOnce<Args>>::call_once
at
/home/xuanwo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1993:9
34: libtest_mimic::run_single::{{closure}}
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libtest-mimic-0.8.1/src/lib.rs:576:43
35: <core::panic::unwind_safe::AssertUnwindSafe<F> as
core::ops::function::FnOnce<()>>::call_once
at
/home/xuanwo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9
36: std::panicking::try::do_call
at
/home/xuanwo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:584:40
37: __rust_try
38: std::panicking::try
at
/home/xuanwo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:547:19
39: std::panic::catch_unwind
at
/home/xuanwo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:358:14
40: libtest_mimic::run_single
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libtest-mimic-0.8.1/src/lib.rs:576:5
41: libtest_mimic::run::{{closure}}::{{closure}}
at
/home/xuanwo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libtest-mimic-0.8.1/src/lib.rs:531:43
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose
backtrace.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]