Dragonfly2 icon indicating copy to clipboard operation
Dragonfly2 copied to clipboard

bug: could not pick infinite rate limit

Open cutecutecat opened this issue 1 year ago • 0 comments

Bug report:

https://github.com/dragonflyoss/Dragonfly2/blob/2b5b96b525ff46dc154637722371818b5a629c3b/cmd/dfget/cmd/root.go#L143 says

The downloading network bandwidth limit per second in format of G(B)/g/M(B)/m/K(B)/k/B, pure number will be parsed as Byte, 0 is infinite

but rateLimit = 0 is invalid, it would trigger:

Error: rate limit must be greater than 20.0MB
2023-05-29T01:52:11.348Z        ERROR   cmd/root.go:121 rate limit must be greater than 20.0MB
d7y.io/dragonfly/v2/cmd/dfget/cmd.Execute
        /go/src/d7y.io/dragonfly/v2/cmd/dfget/cmd/root.go:121
main.main
        /go/src/d7y.io/dragonfly/v2/cmd/dfget/main.go:24
runtime.main
        /usr/local/go/src/runtime/proc.go:250

Expected behavior:

dfget works with infinite rate limit.

How to reproduce it:

ditto

Environment:

  • Dragonfly version: v2.1.0-alpha.6
  • OS: container-optimized os
  • Kernel (e.g. uname -a): Linux XXX + 1 SMP Wed Mar 1 10:08:26 UTC 2023 x86_64 Intel(R) Xeon(R) CPU @ 3.10GHz GenuineIntel GNU/Linux
  • Others:

This error is caused by #1392 side effects, and 0 would be opt-out.

cutecutecat avatar May 29 '23 02:05 cutecutecat