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

Add retry mechanism #66

Merged
merged 2 commits into from
Jun 20, 2024
Merged

Add retry mechanism #66

merged 2 commits into from
Jun 20, 2024

Conversation

vponomaryov
Copy link
Contributor

@vponomaryov vponomaryov commented Mar 5, 2024

With this change it is now possible to configure retry approach for queries.
Following new options are available:

--retry-number=10
--retry-interval=200ms | --retry-interval=100ms,3s
--request-timeout=5

The --retry-number option allows to configure number of retries to be applied
in case of query failures. Default is 10.

The --retry-interval option may store one or two time values separated with comma.
Values may have ms (milliseconds), s (seconds) units.
If 2 are specified then it will be minimum and maximum waiting interval
with exponential growth based on the made attempts. Default is 100ms,5s.

The --request-timeout allows to configure the time for a query after which
it is considered as 'failed'. Measured in seconds. Default is 5.

Print only 5 retry error messages per sample interval.
Also, hide long string and blob values from the retry error messages.

Closes: #60

Before there were 2 separate fn calls in the 'src/main.rs' module:

    let session = context::connect(conf).await?;
    let session = Context::new(session);

With this change we simplify it the way that we will do only one call:

    let session = context::connect(conf).await?;
With this change it is now possible to configure retry approach for queries.
Following new options are available:

  --retry-number=10
  --retry-interval=200ms | --retry-interval=100ms,3s
  --request-timeout=5

The '--retry-number' option allows to configure number of retries to be applied
in case of query failures. Default is '10'.

The '--retry-interval' option may store one or two time values separated
with comma.
Values may have 'ms' (milliseconds), 's' (seconds) units.
If 2 are specified then it will be 'minimum' and 'maximum' waiting interval
with exponential growth based on the made attempts. Default is '100ms,5s'.

The '--request-timeout' allows to configure the time for a query after which
it is considered as 'failed'. Measured in seconds. Default is '5'.

Print only 5 retry error messages per sample interval.
Also, hide long 'string' and 'blob' values from the retry error messages.
Copy link
Owner

@pkolaczk pkolaczk left a comment

Choose a reason for hiding this comment

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

Thank you! Great feature!

@pkolaczk pkolaczk merged commit 0559338 into pkolaczk:main Jun 20, 2024
@fruch
Copy link

fruch commented Jun 20, 2024

@pkolaczk seems to fit nicely ontop a fitting tool :)

we really liked it's approche and flexibility (and the fact it's built ontop of scylla rust driver)

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 retry control
3 participants