-
Notifications
You must be signed in to change notification settings - Fork 929
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
cmd/sync: add 'max-failure' to exit when the transfer encounters more than a certain number of errors #5142
Conversation
Maybe --max-errors or --max-failure? we have --max-failure for warmup |
ok |
…rtain number of errors
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5142 +/- ##
==========================================
- Coverage 44.65% 44.60% -0.05%
==========================================
Files 159 159
Lines 43347 43471 +124
==========================================
+ Hits 19355 19389 +34
- Misses 21566 21656 +90
Partials 2426 2426 ☔ View full report in Codecov by Sentry. |
--fail-fast
to exit as soon as the transfer encounters an errorThere 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.
for supporting fast failed, add context to worker may be more concise and simple
func worker(ctx context.Context, tasks <-chan object.Object, src, dst object.ObjectStorage, config *Config) {
for {
select {
case <-ctx.Done():
// cancel
return
case obj := <-tasks:
// origin logic
}
if failed >= xxx {
ctx.cancel()
...
}
}
}
ok |
df6f90d
to
7022dda
Compare
353107c
to
234b809
Compare
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.
LGTM
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.
this may not work in cluster mode
Let's do it the easy way, it's a little bit more complicated |
65eb02c
to
2f20e48
Compare
2f20e48
to
7b54930
Compare
close #5140