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

Support retries and connection settings #66

Merged
merged 1 commit into from
May 19, 2024

Conversation

lkubb
Copy link
Member

@lkubb lkubb commented May 18, 2024

What does this PR do?

  • Adds retry and backoff logic
  • Adds settings for retry parameters
  • Adds connection timeout settings

What issues does this PR fix or reference?

Fixes: #65

Previous Behavior

No retries, direct failure.

New Behavior

Retries on failure. Supports fine-grained settings for fine-tuning client behavior.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@codecov-commenter
Copy link

codecov-commenter commented May 19, 2024

Codecov Report

Attention: Patch coverage is 95.01558% with 16 lines in your changes are missing coverage. Please review.

Please upload report for BASE (main@b49cb53). Learn more about missing BASE report.

Current head e237864 differs from pull request most recent head a53ab52

Please upload reports for the commit a53ab52 to get more accurate results.

Files Patch % Lines
src/saltext/vault/utils/vault/client.py 91.81% 7 Missing and 2 partials ⚠️
src/saltext/vault/utils/vault/factory.py 60.00% 4 Missing and 2 partials ⚠️
tests/integration/runners/test_vault.py 97.05% 0 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #66   +/-   ##
=======================================
  Coverage        ?   89.63%           
=======================================
  Files           ?       45           
  Lines           ?     7658           
  Branches        ?      774           
=======================================
  Hits            ?     6864           
  Misses          ?      662           
  Partials        ?      132           
Flag Coverage Δ
Linux 89.63% <95.01%> (?)
project 81.60% <88.18%> (?)
py310 89.54% <95.01%> (?)
py39 89.61% <95.01%> (?)
salt_3006_4 89.63% <95.01%> (?)
tests 93.94% <99.48%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lkubb lkubb marked this pull request as ready for review May 19, 2024 06:43
@lkubb
Copy link
Member Author

lkubb commented May 19, 2024

@dagen Does this patch satisfy your needs? You are likely much better equipped to judge what the defaults should be, so feel free to suggest changes. 👍

@lkubb lkubb force-pushed the rate-retry branch 3 times, most recently from 8da7ae7 to cd2fdf9 Compare May 19, 2024 08:32
@dagen
Copy link

dagen commented May 19, 2024

@lkubb This looks amazing! Thanks for the fast turnaround on this. This logic, btw, is elegant:

{backoff_factor} * {Fibonacci(n+3)}

Your defaults look good to me. 👍

@lkubb
Copy link
Member Author

lkubb commented May 19, 2024

@dagen Thanks for quickly reviewing and the kind words. Merging this in then, it will be part of the next release.

I'm still going to wait for salt-extensions/central-artifacts#4 to get some other PRs in before a 1.1 release though (also in order to do some "production" testing with this patch). Hope you have a nice day and thanks again for the feedback!

@lkubb lkubb merged commit 9794f02 into salt-extensions:main May 19, 2024
17 checks passed
@lkubb lkubb deleted the rate-retry branch May 19, 2024 12:58
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.

Support for exponential backup logic on retries
3 participants