Skip to content

Commit

Permalink
Increased S3 artifact retry time and added log (argoproj#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshamajain99 authored and jessesuen committed Jan 24, 2019
1 parent f07b5af commit eaaad7d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions workflow/artifacts/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ func (s3Driver *S3ArtifactDriver) newS3Client() (argos3.S3Client, error) {

// Load downloads artifacts from S3 compliant storage
func (s3Driver *S3ArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error {
err := wait.ExponentialBackoff(wait.Backoff{Duration: time.Millisecond * 10, Factor: 2.0, Steps: 5, Jitter: 0.1},
err := wait.ExponentialBackoff(wait.Backoff{Duration: time.Second * 2, Factor: 2.0, Steps: 5, Jitter: 0.1},
func() (bool, error) {

log.Infof("ExponentialBackoff in S3 Load for path: %s", path)
s3cli, err := s3Driver.newS3Client()
if err != nil {
log.Warnf("Failed to create new S3 client: %v", err)
Expand All @@ -46,7 +46,7 @@ func (s3Driver *S3ArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string
return true, nil
}
if !argos3.IsS3ErrCode(origErr, "NoSuchKey") {
return false, origErr
return false, nil
}
// If we get here, the error was a NoSuchKey. The key might be a s3 "directory"
isDir, err := s3cli.IsDirectory(inputArtifact.S3.Bucket, inputArtifact.S3.Key)
Expand All @@ -70,8 +70,9 @@ func (s3Driver *S3ArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string

// Save saves an artifact to S3 compliant storage
func (s3Driver *S3ArtifactDriver) Save(path string, outputArtifact *wfv1.Artifact) error {
err := wait.ExponentialBackoff(wait.Backoff{Duration: time.Millisecond * 10, Factor: 2.0, Steps: 5, Jitter: 0.1},
err := wait.ExponentialBackoff(wait.Backoff{Duration: time.Second * 2, Factor: 2.0, Steps: 5, Jitter: 0.1},
func() (bool, error) {
log.Infof("ExponentialBackoff in S3 Save for path: %s", path)
s3cli, err := s3Driver.newS3Client()
if err != nil {
log.Warnf("Failed to create new S3 client: %v", err)
Expand Down

0 comments on commit eaaad7d

Please sign in to comment.