[debugsyms] Increase default timeout
Debug symbol uploads are timing out with some frequency during chromium
rolls, e.g. ci.chromium.org/b/8801552556289462033. I see no harm in
raising the timeout.
Also improve error messages so we only emit a "timed out" log for upload
jobs that actually time out, and a separate "canceled" log for jobs that
got canceled as a result of a concurrent job timing out.
Change-Id: I0bf1c5d7b360a96be7d25bcc76d0967191f5b2cc
Reviewed-on: https://fuchsia-review.googlesource.com/c/tools/+/735722
Fuchsia-Auto-Submit: Oliver Newman <olivernewman@google.com>
Reviewed-by: Anthony Fandrianto <atyfto@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
diff --git a/debugsyms/cmd/upload.go b/debugsyms/cmd/upload.go
index a8b8765..e54f243 100644
--- a/debugsyms/cmd/upload.go
+++ b/debugsyms/cmd/upload.go
@@ -44,7 +44,7 @@
func (cmd *uploadCommand) SetFlags(f *flag.FlagSet) {
f.StringVar(&cmd.bucket, "bucket", "", "GCS bucket to upload symbols to")
- f.DurationVar(&cmd.timeout, "timeout", 10*time.Minute, "timeout duration per upload")
+ f.DurationVar(&cmd.timeout, "timeout", 20*time.Minute, "timeout duration per upload")
f.IntVar(&cmd.j, "j", 500, "number of concurrent uploading routines")
}
diff --git a/debugsyms/cmd/worker.go b/debugsyms/cmd/worker.go
index f97dd5d..44bf0b4 100644
--- a/debugsyms/cmd/worker.go
+++ b/debugsyms/cmd/worker.go
@@ -6,6 +6,7 @@
import (
"context"
+ "errors"
"fmt"
"sync"
"time"
@@ -41,7 +42,11 @@
errs <- fmt.Errorf("job %s failed: %v", job.name, err)
}
case <-ctx.Done():
- errs <- jobTimeout{job: job, timeout: timeout}
+ if errors.Is(ctx.Err(), context.DeadlineExceeded) {
+ errs <- jobTimeout{job: job, timeout: timeout}
+ } else {
+ errs <- fmt.Errorf("job %s was canceled", job.name)
+ }
}
}
}