From 8681ea6026b67047d015ba228f498a8d3af01acf Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Wed, 21 Jun 2017 15:56:29 -0700 Subject: [PATCH] report panic comment and shorter timeout --- packer/telemetry.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packer/telemetry.go b/packer/telemetry.go index 25aaef013..b815cd0e1 100644 --- a/packer/telemetry.go +++ b/packer/telemetry.go @@ -76,7 +76,9 @@ func (c *CheckpointTelemetry) ReportPanic(m string) error { panicParams.Payload = m panicParams.EndTime = time.Now().UTC() - ctx, cancel := context.WithTimeout(context.Background(), 4500*time.Millisecond) + // This timeout can be longer because it runs in the real main. + // We're also okay waiting a bit longer to collect panic information + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() return checkpoint.Report(ctx, panicParams)