Skip to content

bug: dav-server-opendalfs: OpendalFile drops opendal::Writer without close() or abort() on write failure #7425

Description

@andrei-21

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 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?

  • Yes, I would like to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleases-note/fixThe PR fixes a bug or has a title that begins with "fix"services/webdav

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions