Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Mark some API methods as safe to retry POST on #97

Open
lkubb opened this issue Nov 7, 2024 · 0 comments
Open

[FEATURE REQUEST] Mark some API methods as safe to retry POST on #97

lkubb opened this issue Nov 7, 2024 · 0 comments

Comments

@lkubb
Copy link
Member

lkubb commented Nov 7, 2024

Is your feature request related to a problem? Please describe.
By default, the client does not retry any POST/PATCH requests for good reason.

However, there are some API methods where we can safely retry these requests, for example lookups or unwrapping.

Related: #95

Describe the solution you'd like
Retry POST/PATCH requests on allowlisted paths by default.

Describe alternatives you've considered
Enabling retry_post completely, which can result in unexpected behavior since it's potentially non-idempotent.

Additional context
This is a bit tricky since the VaultRetry instance does not receive URL details. We might need to do it similar to this mockup in saltext.vault.utils.vault.client.VaultClient.request_raw:

if method in ("POST", "PATCH") and endpoint in SAFE_TO_RETRY_POST:
    saved_retry_post, self.session.max_retries.retry_post = self.session.max_retries.retry_post, True
    try:
        # ...
    finally:
        self.session.max_retries.retry_post = saved_retry_post
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

No branches or pull requests

1 participant