Add image pull concurrency limit.#2920
Conversation
pkg/concurrencylimiter/limiter.go
Outdated
There was a problem hiding this comment.
return error if limit < 1 ?
pkg/concurrencylimiter/limiter.go
Outdated
There was a problem hiding this comment.
I think we should use ctx.Err() here because it might be timeout caused by deadline.
84ae6ec to
0f97382
Compare
Codecov Report
@@ Coverage Diff @@
## master #2920 +/- ##
==========================================
- Coverage 43.97% 41.41% -2.56%
==========================================
Files 102 70 -32
Lines 10874 9457 -1417
==========================================
- Hits 4782 3917 -865
+ Misses 5359 4979 -380
+ Partials 733 561 -172
Continue to review full report at Codecov.
|
cpuguy83
left a comment
There was a problem hiding this comment.
Looks pretty straight forward. Not a huge fan of adding a new argument to Dispatch, but I don't have a good suggestion at the moment for another approach.
pkg/concurrencylimiter/limiter.go
Outdated
There was a problem hiding this comment.
Seems like this could just be https://godoc.org/golang.org/x/sync/semaphore
There was a problem hiding this comment.
Cool. I didn't know there is such package, this is exactly what I want at the beginning. Didn't find it in golang sync, thus implemented one with channel myself.
Will use this instead.
0f97382 to
a8e32b3
Compare
images/handlers.go
Outdated
There was a problem hiding this comment.
Make sure to update the godoc.
a8e32b3 to
5104855
Compare
|
@Random-Liu needs a rebase. thanks! |
Signed-off-by: Lantao Liu <lantaol@google.com>
5104855 to
d7ed403
Compare
|
@ehazlett Done |
|
LGTM |
1 similar comment
|
LGTM |
For #2886
Fixes #2195
MaxConcurrentDownloads = 3): 28.89sThe result is almost the same with docker now! :)
Signed-off-by: Lantao Liu lantaol@google.com