-
Notifications
You must be signed in to change notification settings - Fork 10
Add possibility to stop execution after specific number of errors #36
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
Changes from 1 commit
2a6718e
1ceca26
02ab5e6
054ce8d
bee64e1
0aa86e8
25cede3
dde50c0
a92312a
d39e3f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,7 @@ pub(crate) struct ScyllaBenchArgs { | |
| pub mode: Mode, | ||
| pub latency_type: LatencyType, | ||
| pub max_consecutive_errors_per_op: u64, | ||
| pub max_errors_in_total: u64, | ||
| pub concurrency: u64, | ||
| pub maximum_rate: u64, | ||
|
|
||
|
|
@@ -178,6 +179,12 @@ where | |
| After exceeding it, the workflow will terminate with an error. \ | ||
| Set to 0 if you want to disable this limit", | ||
| ); | ||
| let max_errors = flag.u64_var( | ||
| "error-limit", | ||
| 0, | ||
| "the number of total errors after which the workflow should stop and fail; \ | ||
| set it to 0 (the default) to disable this limit", | ||
| ); | ||
| let concurrency = flag.u64_var("concurrency", 16, "number of used tasks"); | ||
| let maximum_rate = flag.u64_var( | ||
| "max-rate", | ||
|
|
@@ -332,6 +339,9 @@ where | |
| // therefore just subtract with wraparound and treat u64::MAX as infinity | ||
| let max_consecutive_errors_per_op = max_errors_at_row.get().wrapping_sub(1); | ||
|
|
||
| // Similar to above | ||
| let max_errors_in_total = max_errors.get().wrapping_sub(1); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to make sure i understand correctly - this option (unlike If so, then this |
||
|
|
||
| let hdr_latency_resolution = match hdr_latency_units.get().as_str() { | ||
| "ns" => 1, | ||
| "us" => 1000, | ||
|
|
@@ -377,6 +387,7 @@ where | |
| concurrency, | ||
| latency_type, | ||
| max_consecutive_errors_per_op, | ||
| max_errors_in_total, | ||
| maximum_rate, | ||
| test_duration: test_duration.get(), | ||
| partition_count, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the above comments. From what I understood, the
error-at-row-limitdefines the number of errors that can occur before failing. In other words, it defines the number of retries - in the worst case scenario we should try to perform the operationerror-at-row-limit + 1times (first try +error-at-row-limitretries).I think we should either change it to
Option<NonZeroU64>(set toNonewhenerror-at-row-limitis 0) and remove thewrapping_subor change the>=to>inWorkerSession::end_operationhere:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be also nice to add tests for edge cases such as
error-at-row-limit = 1. In this case, the following scenario would be OK:, but this should fail:
As of now, I believe that the first scenario wouldn't pass since we use
wrapping_sub(1)and we make use of>=comparison.