Skip to content

Commit

Permalink
storagenode/gracefulexit: make minimum transfer speed to be 5KiB
Browse files Browse the repository at this point in the history
with 128B/sec, a satellite with 10min default timeout could already
closed its connection to a node even though the node was able to
compelete the transfer.

Change-Id: I6173d6473a62c6d0b0e0a8765c1ae0a5e57b0a08
  • Loading branch information
VinozzZ authored and Yingrong Zhao committed Jun 23, 2020
1 parent ed9816f commit 51dfc6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storagenode/gracefulexit/worker.go
Expand Up @@ -234,8 +234,8 @@ func (worker *Worker) transferPiece(ctx context.Context, transferPiece *pb.Trans
}

if worker.minBytesPerSecond == 0 {
// set minBytesPerSecond to default 128B if set to 0
worker.minBytesPerSecond = 128 * memory.B
// set minBytesPerSecond to default 5KiB if set to 0
worker.minBytesPerSecond = 5 * memory.KiB
}
maxTransferTime := time.Duration(int64(time.Second) * originalHash.PieceSize / worker.minBytesPerSecond.Int64())
if maxTransferTime < worker.minDownloadTimeout {
Expand Down

0 comments on commit 51dfc6b

Please sign in to comment.