Quit calculating difference for any listing error (#2440)

If we have any listing problem, we should stop comparing difference
between source & target lists because it is already so hard to know
what mc should do next. So, let's inform users and let them deal
with the problem.
This commit is contained in:
Anis Elleuch
2018-04-26 11:21:10 -07:00
committed by Dee Koder
parent 75e9691616
commit 182ad295d8
3 changed files with 4 additions and 7 deletions
+2 -4
View File
@@ -98,14 +98,12 @@ func difference(sourceClnt, targetClnt Client, sourceURL, targetURL string, isRe
if !srcEOF && srcCtnt.Err != nil {
diffCh <- diffMessage{Error: srcCtnt.Err.Trace(sourceURL, targetURL)}
srcCtnt, srcOk = <-srcCh
continue
return
}
if !tgtEOF && tgtCtnt.Err != nil {
diffCh <- diffMessage{Error: tgtCtnt.Err.Trace(sourceURL, targetURL)}
tgtCtnt, tgtOk = <-tgtCh
continue
return
}
// If source doesn't have objects anymore, comparison becomes obvious
+1 -2
View File
@@ -581,15 +581,14 @@ func (mj *mirrorJob) mirror(ctx context.Context, cancelMirror context.CancelFunc
switch err.ToGoError().(type) {
case BrokenSymlink, TooManyLevelsSymlink, PathNotFound,
PathInsufficientPermission, ObjectOnGlacier:
errorIf(err, "Unable to perform a mirror action.")
continue
case deleteNotAllowedErr, overwriteNotAllowedErr:
errorIf(err, "Unable to perform a mirror action.")
continue
}
return err.Trace()
}
}
}
+1 -1
View File
@@ -117,7 +117,7 @@ func deltaSourceTarget(sourceURL, targetURL string, isFake, isOverwrite, isRemov
if diffMsg.Error != nil {
// Send all errors through the channel
URLsCh <- URLs{Error: diffMsg.Error}
continue
return
}
srcSuffix := strings.TrimPrefix(diffMsg.FirstURL, sourceURL)