Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcsupload: limit maximum upload concurrency #16658

Conversation

stevekuznetsov
Copy link
Contributor

Signed-off-by: Steve Kuznetsov skuznets@redhat.com

/cc @fejta @cjwagner @smarterclayton

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 6, 2020
for dest, upload := range uploadTargets {
log := logrus.WithField("dest", dest)
if err := sem.Acquire(context.Background(), 1); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: it's actually the dtw(dest) call we make in creating the closure that allocates, so we need to guard that

@k8s-ci-robot k8s-ci-robot added area/prow Issues or PRs related to prow area/prow/gcsupload Issues or PRs related to prow's gcsupload component area/prow/pod-utilities Issues or PRs related to prow's pod-utilities component sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Mar 6, 2020
prow/gcsupload/options.go Outdated Show resolved Hide resolved
@stevekuznetsov stevekuznetsov force-pushed the skuznets/limit-gcsupload-paralellism branch from ddaa716 to 114bda2 Compare March 6, 2020 19:27
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 6, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fejta, stevekuznetsov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 6, 2020
@stevekuznetsov stevekuznetsov force-pushed the skuznets/limit-gcsupload-paralellism branch from 114bda2 to 3a27750 Compare March 6, 2020 22:04
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 6, 2020
@stevekuznetsov stevekuznetsov force-pushed the skuznets/limit-gcsupload-paralellism branch from 3a27750 to 6a7a272 Compare March 6, 2020 22:07
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 6, 2020
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
@stevekuznetsov stevekuznetsov force-pushed the skuznets/limit-gcsupload-paralellism branch from 6a7a272 to 6b72630 Compare March 6, 2020 23:09
@@ -38,11 +39,11 @@ type destToWriter func(dest string) dataWriter
// Upload uploads all of the data in the
// uploadTargets map to GCS in parallel. The map is
// keyed on GCS path under the bucket
func Upload(bucket *storage.BucketHandle, uploadTargets map[string]UploadFunc) error {
func Upload(bucket *storage.BucketHandle, uploadTargets map[string]UploadFunc, maxConcurrency int64) error {
dtw := func(dest string) dataWriter {
return gcsObjectWriter{bucket.Object(dest).NewWriter(context.Background())}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of orthogonal to this PR, but we should be using a context with a timeout here so that we don't try to upload a file forever, especially now that that could prevent other files from being uploaded as well.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 6, 2020
@smarterclayton
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot merged commit 0770780 into kubernetes:master Mar 6, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/prow/gcsupload Issues or PRs related to prow's gcsupload component area/prow/pod-utilities Issues or PRs related to prow's pod-utilities component area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants