Skip to content

fix: default retry_writes to False for DocumentDB connections - #54

Open
beneboy wants to merge 1 commit into
mainfrom
documentdb-retry-writes-default
Open

beneboy wants to merge 1 commit into
mainfrom
documentdb-retry-writes-default

Conversation

@beneboy

@beneboy beneboy commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Amazon DocumentDB engine versions before 8.0.2 reject retryable writes. DocumentDbConnectionConfig inherited retry_writes = True from MongoConnectionConfig, so a DocumentDB connection created with the SDK defaulted to retryable writes on, and DocumentDB rejected the run-history insert.

Changes

  • DocumentDbConnectionConfig defaults retry_writes to False, as CosmosDbConnectionConfig does.
  • retry_writes is always sent for DocumentDB, even when it equals the default. Some server versions store true for a DocumentDB connection that leaves the field out, so pruning the default would not be safe.
  • The other Mongo-family configs are unchanged: they still omit retry_writes when it equals their own default.

Testing

  • make test: 550 passed.
  • make lint: ruff, ruff format and mypy are clean.

Amazon DocumentDB engine versions before 8.0.2 reject retryable writes, so
`DocumentDbConnectionConfig` now defaults `retry_writes` to False, as
`CosmosDbConnectionConfig` does.

The value is always sent for DocumentDB, even when it equals the default.
Some server versions store true for a DocumentDB connection that leaves the
field out, and DocumentDB then rejects the run-history insert.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant