bug: dav-server-opendalfs: OpendalFile drops opendal::Writer without close() or abort() on write failure
bugservices/webdavreleases-note/fix
### Describe the bug
`dav-server-opendalfs` appears to violate the `opendal::Writer` lifecycle requirement in its `OpendalFile` implementation.
In `src/file.rs` if a write path fails before `close()`, the writer is left to be dropped without an explicit `abort()`.
That seems incompatible with the `opendal::Writer` documentation, which says callers must terminate the writer explicitly with either `close()` or `abort()`.
### Steps to Reproduce
See the test in https://github.com/apache/opendal/compare/main...andrei-21:opendal:test/abort-on-failure.
### Expected Behavior
If a write path cannot be completed successfully, `dav-server-opendalfs` should explicitly terminate the underlying OpenDAL writer lifecycle.
### Additional Context
Logs
```
DEBUG request{method=PUT uri="http://localhost/dav/pub/two.bin" version=HTTP/1.1}: dav_server::davhandler: == START REQUEST Put /pub/two.bin
WARN request{method=PUT uri="http://localhost/dav/pub/two.bin" version=HTTP/1.1}: opendal::layers::complete: writer has not been closed or aborted, must be a bug
DEBUG request{method=PUT uri="http://localhost/dav/pub/two.bin" version=HTTP/1.1}: dav_server::davhandler: == END REQUEST result FsError(GeneralFailure)
ERROR request{method=PUT uri="http://localhost/dav/pub/two.bin" version=HTTP/1.1}: tower_http::trace::on_failure: response failed classification=Status code: 500 Internal Server Error latency=4 ms
```
### Are you willing to submit a PR to fix this bug?
- [x] Yes, I would like to submit a PR.
关闭于 2026-05-13 2 条评论