Xuanwo opened a new pull request, #8807:
URL: https://github.com/apache/opendal/pull/8807
# Which issue does this PR close?
None. This is a core panic found while reviewing the blocking delete APIs;
the regression tests reproduce it deterministically.
# Rationale for this change
`blocking::Operator::{delete_iter, delete_try_iter}` and
`blocking::Deleter::{delete_iter, delete_try_iter}` passed the whole iterator
to the async API inside one `Handle::block_on`. A `blocking::Lister` calls
`Handle::block_on` in both `next()` and `drop()`, so using a lister as the
iterator, or calling any blocking method from the iterator, nested a runtime
and panicked with "Cannot start a runtime from within a runtime". With a
lister, the panic in `drop()` during unwinding aborts the process.
# What changes are included in this PR?
- Consume blocking delete iterators on the caller thread, calling the
blocking `delete` for each entry, so iterator `next()` and `drop()` never run
inside `block_on`.
- Implement `blocking::Operator::{delete_iter, delete_try_iter}` with
`deleter()`, `delete_*_iter()`, and `close()` to mirror the async operator path.
- Add deterministic memory-backed regression tests for lister-fed operator
and deleter deletion, early iterator errors dropping a lister, and an iterator
that calls `blocking::Operator::exists`.
# Are there any user-facing changes?
Yes. `blocking::Operator::{delete_iter, delete_try_iter}` and
`blocking::Deleter::{delete_iter, delete_try_iter}` no longer panic when the
iterator uses blocking OpenDAL APIs, including a `blocking::Lister`. Signatures
and error propagation are unchanged; there are no API changes.
# Breaking changes
# AI Usage Statement
- Harness: Pi coding agent 1.5.2, launched through T3 Code.
- Model: magpie group/deepseek.
- Effort: max.
- Role: Reproduced the panic with regression tests, implemented the fix, and
ran formatting, lint, unit, and doc-test validation. The tests use the memory
service only. The accountable human author remains responsible for every
submitted claim and change.
--
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]