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

command/sync: handle object listing errors #597

Merged
merged 30 commits into from
Aug 4, 2023

Conversation

ahmethakanbesel
Copy link
Contributor

@ahmethakanbesel ahmethakanbesel commented Jul 18, 2023

Resolves #564

Changes are made:

  • Added exit-on-error flag. Its value is false by default.
  • Added shouldStopSync function. It determines whether a sync process should be stopped or not. It does not ignore the errors AccessDenied and NoSuchBucket regardless of the value of exit-on-error flag.
  • sync command stops if an error is received when listing objects from source or destination when the exit-on-error flag is true. But it always ignores the ErrNoObjectFound error.

@ahmethakanbesel ahmethakanbesel marked this pull request as ready for review July 18, 2023 08:38
@ahmethakanbesel ahmethakanbesel requested a review from a team as a code owner July 18, 2023 08:38
@ahmethakanbesel ahmethakanbesel requested review from ilkinulas and sonmezonur and removed request for a team July 18, 2023 08:38
command/sync.go Outdated Show resolved Hide resolved
command/sync.go Outdated Show resolved Hide resolved
sonmezonur
sonmezonur previously approved these changes Jul 25, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: İlkin Balkanay <ilkinulas@gmail.com>
command/sync.go Outdated Show resolved Hide resolved
sonmezonur
sonmezonur previously approved these changes Jul 28, 2023
sonmezonur
sonmezonur previously approved these changes Jul 28, 2023
}

// sync --exit-on-error s3://bucket/* s3://NotExistingBucket/ (dest bucket doesn't exist)
func TestSyncExitOnErrorS3BucketToS3BucketThatDoesNotExist(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

This test case does not adequately test the --exit-on-error flag, because if the bucket does not exist, the flag will have no effect. It would be better to test the flag with an error other than "AccessDenied" or "NoSuchBucket".

@ilkinulas ilkinulas merged commit cb948fa into peak:master Aug 4, 2023
13 checks passed
@ahmethakanbesel ahmethakanbesel deleted the sync-handle-errors branch August 4, 2023 07:14
@igungor igungor mentioned this pull request Sep 13, 2023
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.

[BUG] Sync Continues, Despite Failure to List S3 Bucket
3 participants