Xuanwo opened a new pull request, #8763: URL: https://github.com/apache/opendal/pull/8763
# Which issue does this PR close? None. Both bugs were found during maintenance review of the `unftp-sbe` backend. # Rationale for this change `rmd` passed a directory path to recursive deletion without a trailing slash. On prefix-based services such as `memory`, deleting `d` also matches `dd/`, so `RMD d` irreversibly removed sibling directories. The FTP root had the same problem: `RMD /` would recursively delete every object under the operator. `put` always shut down the writer after copying, including when reading the input or writing to storage failed. Shutdown committed the bytes copied so far, so a failed `STOR` could overwrite an existing object with truncated content. # What changes are included in this PR? - `rmd` rejects the FTP root, validates that the target is a directory, and passes `d/` to recursive deletion so only the named directory is removed. - `put` aborts the writer when the copy loop fails instead of closing it. Abort failures are reported alongside the original error. - Regression tests cover sibling preservation, root and non-directory rejection, and failed puts on `memory` and staged `fs` writes. # Are there any user-facing changes? `RMD` now fails with a 550-class error for the root, missing paths, and regular files instead of deleting a file or silently succeeding. `STOR` no longer commits partial data when the input fails, on services that support aborting a writer. `fs` without `atomic_write_dir` cannot roll back an in-place write; that service returns an abort error alongside the original failure. Enabling `atomic_write_dir` makes abort clean. # Breaking changes None. # AI Usage Statement - Harness: pi coding agent (T3 Code) - Model: group/deepseek - Effort: max - Role: Implemented both fixes and the regression tests, and ran formatting, clippy, and the integration test suite. Assumption: abort is best-effort because some storage services do not support it; tests cover memory and fs with atomic staging. -- 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]
