Mola-maker opened a new pull request, #9059:
URL: https://github.com/apache/opendal/pull/9059

   # Which issue does this PR close?
   
   Closes #9058.
   
   # Rationale for this change
   
   A `put_part` future waits for the previous part's future to be polled to 
success. Awaiting the futures in a different order than they were created 
therefore hangs forever. object_store allows these futures to be polled in 
parallel, and its `multipart_out_of_order` conformance test awaits them out of 
order.
   
   # What changes are included in this PR?
   
   - `put_part` now queues its payload in call order in the upload state and 
registers the part as pending.
   - The first part future to take the writer lock writes every queued part in 
order, its own part included. So the futures can be awaited in any order, and 
writes stay sequential and in call order.
   - A part future that fails or is dropped before it succeeds still poisons 
the upload, so later parts and `complete` fail as before. The oneshot 
notification chain is removed, together with the now unused `asyncband` 
`oneshot` feature.
   - `test_multipart_out_of_order_polling_preserves_part_order` used to assert 
that the second part stays `Pending` until the first one is polled. That is the 
behavior that caused the hang. The test now creates three parts, awaits them in 
the order 2, 3, 1 under a 10 s timeout, and checks the content is `ABC`.
   
   Verification (Windows 11, rustc 1.99.1):
   
   - The updated test times out on main and passes with this change.
   - `cargo test --no-fail-fast` in `integrations/object_store`:
     - lib: 86 passed and 1 failed. All multipart tests pass, including the 
poisoning tests for dropped, failed and pending parts. The failure is 
`test_directories_return_not_found_on_head_and_get`, which asserts object_store 
`LocalFileSystem` behavior and fails the same way on main on Windows.
     - `tests/backends`: 7 passed.
     - `tests/behavior`: 5 passed.
   - `cargo clippy --all-targets -- -D warnings`: clean on Windows.
   - object_store's `integration::multipart_out_of_order` now passes on 
`memory` and `fs`. It timed out before this change.
   
   # Are there any user-facing changes?
   
   Multipart part futures can now be awaited in any order. Before, awaiting 
them out of order hung.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - Harness: Claude Code
   - Model: Anthropic Claude
   - Effort: default
   - Role: Found the hang by running object_store's `integration` conformance 
suite against `OpendalStore`, wrote the fix and the test, and ran the checks 
above. A separate review pass checked concurrency, cancellation and lock 
handling, and flagged a stale doc comment that is now fixed.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to