From: Michael Matloob Date: Mon, 13 May 2024 18:59:02 +0000 (-0400) Subject: cmd/go: don't start upload until after toolchain selection X-Git-Tag: go1.23rc1~328 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=13d36a9b46c7beeb49ffc623d5ab0568840b277b;p=gostls13.git cmd/go: don't start upload until after toolchain selection Run telemetry.Start (without the upload) first thing so we can increment counters in toolchain selection. Then run telemetry.StartWithUpload after toolchain selection so we don't start the upload until after toolchain selection has happened so we don't start something heavyweight before selection. Change-Id: Ia8979175a163265c3e29f6cb11a4ada4714d1d95 Reviewed-on: https://go-review.googlesource.com/c/go/+/585419 LUCI-TryBot-Result: Go LUCI Reviewed-by: Hyang-Ah Hana Kim Reviewed-by: Sam Thanawalla --- diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go index 72656dd903..3fe5cd4ee1 100644 --- a/src/cmd/go/main.go +++ b/src/cmd/go/main.go @@ -92,10 +92,11 @@ var counterErrorsGOPATHEntryRelative = telemetry.NewCounter("go/errors:gopath-en func main() { log.SetFlags(0) - telemetry.StartWithUpload() // Open the telemetry counter file so counters can be written to it. + telemetry.Start() // Open the telemetry counter file so counters can be written to it. handleChdirFlag() toolchain.Select() + telemetry.StartWithUpload() // Run the upload process. Opening the counter file is idempotent. flag.Usage = base.Usage flag.Parse() telemetry.Inc("go/invocations")