Skip to content

Initial retries support - #114

Draft
toptobes wants to merge 11 commits into
masterfrom
KG-initial-retry-impl
Draft

Initial retries support#114
toptobes wants to merge 11 commits into
masterfrom
KG-initial-retry-impl

Conversation

@toptobes

Copy link
Copy Markdown
Collaborator

No description provided.

/* c8 ignore next: exceptional case */
: {};

clonedData = structuredClone(data);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this structured clone so that user-registered handlers don't accidentally modify data? If so, that's reasonable, just wondering.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That, and also so that it stays as the raw JSON response instead of running through the deserializer.

It's not a solution I'm very happy with though (structured clone isn't super performant and it isn't always even used here, and I plan to rectify it in a future release)

Comment thread etc/astra-db-ts.api.md
// @public
export interface CommandOptions<Spec extends CommandOptionsSpec = Required<CommandOptionsSpec>> {
// (undocumented)
isSafelyRetryable?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you imagine users will set isSafelyRetryable on every command they want to be able to retry? Or will isSafelyRetryable be set on commands like findOne() that are read only by default?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isSafelyRetryable will be an option people can use to force-set a method as either idempotent or not; otherwise, each method will have its own default idempotency.

Btw retries are still a far-fetched idea in its early experimental stage, so I wouldn't pay them too much heed for the time being 🙂 there's a very rough brain-dump-like spec in our internal "yellow doc" which you should have access to if you want more information.

@toptobes
toptobes marked this pull request as draft February 9, 2026 07:02
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.

2 participants