Skip to content

Commit

Permalink
Don't lock destination when its dev/null (#652)
Browse files Browse the repository at this point in the history
Since all files have same destination in that case, and the locking gets annoyed (and is totally unnecessary)
  • Loading branch information
JohnRusk committed Oct 7, 2019
1 parent 4bf8b0e commit 75debe6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ste/mgr-JobPartTransferMgr.go
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/http"
"strings"
"sync/atomic"
"time"

Expand Down Expand Up @@ -300,6 +301,10 @@ func (jptm *jobPartTransferMgr) FileCountLimiter() common.CacheLimiter {
// (iii) For completeness, there's also bucket->container name resolution when copying from S3, but that is not expected to ever
// create collisions, since it already takes steps to prevent them.
func (jptm *jobPartTransferMgr) WaitUntilLockDestination(ctx context.Context) error {
if strings.EqualFold(jptm.Info().Destination, common.Dev_Null) {
return nil // nothing to lock
}

if jptm.useFileCountLimiter() {
err := jptm.jobPartMgr.FileCountLimiter().WaitUntilAdd(ctx, 1, func() bool { return true })
if err != nil {
Expand Down

0 comments on commit 75debe6

Please sign in to comment.