Skip to content

feat: Enhance the output while writer close with error #7044

@carlsverre

Description

@carlsverre

Describe the bug

I see the following error on Tigris and Minio when using WriteOption::if_not_exists:

060.244s DEBUG Action::run{action=RemoteCommit { vid: 3nXPhhLYtD7ZN }}:put_commit{log=74ggeHXDbm-2tZGLRnRwZAeQ lsn=8}: opendal::services: service=s3 name=graft-primary path=logs/74ggeHXDbm-2tZGLRnRwZAeQ/commits/fffffffffffffff7: write started
060.245s DEBUG Action::run{action=RemoteCommit { vid: 3nXPhhLYtD7ZN }}:put_commit{log=74ggeHXDbm-2tZGLRnRwZAeQ lsn=8}: opendal::services: service=s3 name=graft-primary path=logs/74ggeHXDbm-2tZGLRnRwZAeQ/commits/fffffffffffffff7: write created writer
060.334s  WARN Action::run{action=RemoteCommit { vid: 3nXPhhLYtD7ZN }}:put_commit{log=74ggeHXDbm-2tZGLRnRwZAeQ lsn=8}: opendal::services: service=s3 name=graft-primary path=logs/74ggeHXDbm-2tZGLRnRwZAeQ/commits/fffffffffffffff7 written=105: write close failed ConditionNotMatch (persistent) at write, context: { uri: https://t3.storage.dev/graft-primary/logs/74ggeHXDbm-2tZGLRnRwZAeQ/commits/fffffffffffffff7, response: Parts { status: 412, version: HTTP/1.1, headers: {"access-control-allow-headers": "*", "access-control-allow-methods": "*", "access-control-allow-origin": "*", "access-control-expose-headers": "*", "content-length": "400", "content-type": "application/xml", "server": "Tigris OS", "server-timing": "total;dur=50", "strict-transport-security": "max-age=63072000; includeSubDomains; preload", "x-amz-request-id": "1765944010531049946", "date": "Wed, 17 Dec 2025 04:00:10 GMT"} }, service: s3, path: logs/74ggeHXDbm-2tZGLRnRwZAeQ/commits/fffffffffffffff7, written: 105 } => S3Error { code: "PreconditionFailed", message: "At least one of the pre-conditions you specified did not hold", resource: "/graft-primary/logs/74ggeHXDbm-2tZGLRnRwZAeQ/commits/fffffffffffffff7", request_id: "1765944010531049946" }
060.334s DEBUG Action::run{action=RemoteCommit { vid: 3nXPhhLYtD7ZN }}:put_commit{log=74ggeHXDbm-2tZGLRnRwZAeQ lsn=8}: opendal::services: service=s3 name=graft-primary path=logs/74ggeHXDbm-2tZGLRnRwZAeQ/commits/fffffffffffffff7 written=105: write close failed
060.334s  WARN Action::run{action=RemoteCommit { vid: 3nXPhhLYtD7ZN }}:put_commit{log=74ggeHXDbm-2tZGLRnRwZAeQ lsn=8}: opendal_core::layers::complete: writer has not been closed or aborted, must be a bug

Steps to Reproduce

Write to Tigris or Minio (and possibly other object_stores) using this request:

        self.store
            .write_options(
                &path,
                commit.encode_to_bytes(),
                WriteOptions {
                    // Perform an atomic write operation, returning
                    // a precondition error if the commit already exists
                    if_not_exists: true,
                    concurrent: REMOTE_CONCURRENCY,
                    ..WriteOptions::default()
                },
            )
            .await?;

Expected Behavior

The writer is properly closed, or the CompletionLayer treats this as an expected case.

Additional Context

No response

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions