You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "dentiny (via GitHub)" <gi...@apache.org> on 2026/07/23 06:00:04 UTC

[PR] fix(core): fix error propagation [opendal]

dentiny opened a new pull request, #7940:
URL: https://github.com/apache/opendal/pull/7940

   # Which issue does this PR close?
   
   N/A
   
   # Rationale for this change
   
   Hi team, I found when I'm using synchronous IO, it often retries more than I expected. See my regression test for details.
   
   I think the root cause is
   - For now, we map most of the OpenDAL errors into Interrupted error
   - `std::io::Read` is documented to retry on interrupted error: https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/std/io/trait.Read.html#errors
   - code reference: https://doc.rust-lang.org/src/std/io/mod.rs.html#479
   
   ```rs
   // Note that we don't track already initialized bytes here, but this is fine
   // because we explicitly limit the read size
     let mut cursor = read_buf.unfilled();
     let result = loop {
       match r.read_buf(cursor.reborrow()) {
         Err(e) if e.is_interrupted() => continue,
           // Do not stop now in case of error: we might have received both data
           // and an error
           res => break res,
         }
   };
   ```
   
   I think it's not ideal because
   - Extra retries are attempted even for persistent errors, which we shouldn't retry upon
   - When retry layer is injected, extra retries are proceeded, even retry attempts have been exhausted
   - There's no retry limit control -- it just retries forever
   
   # What changes are included in this PR?
   
   In this PR, I updated the std IO error from "interrupted" to "other", so it's directly propagated up; I checked [OpenDAL errors](https://github.com/apache/opendal/blob/19e028238cdc11398099bd25a8ef7895a15d68a7/core/core/src/types/error.rs#L48-L89), no errors should be mapped to "interrupted".
   If retry is necessary, users could configure retry wrapper.
   
   # Are there any user-facing changes?
   
   No
   
   # AI Usage Statement
   
   AI helped me find out the source code.


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(core): not translate to "interrupted" std IO error [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #7940:
URL: https://github.com/apache/opendal/pull/7940


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org