x/playground: timeout compiling trivial code that imports net/http

If I try to run the example here:

https://golang.org/pkg/net/http/httputil#DumpResponse

I get this:

~~~ timeout running go build

Go build failed. ~~~

Same result if using same code on the playground:

https://play.golang.org/p/nf79uLXs5-b

If I run locally, it works fine:

~~~ "HTTP/1.1 200 OK\r\nContent-Length: 76\r\nContent-Type: text/plain; charset=utf-8\r\nDate: Wed, 19 Jul 1972 19:00:00 GMT\r\n\r\nGo is a general-purpose language designed with systems programming in mind.\n" ~~~

Asked Dec 23 '21 01:12
avatar 89z
89z

13 Answer:

It seems to happen with an even simpler program that imports net/http for side-effects only. For example, I'm getting a "timeout running go build" when trying to run:

package main

import (
    _ "fmt"
    _ "net/http"
)

func main() {
    fmt.Println("output")
}

Instead of the expected build error like "./prog.go:8:2: undefined: fmt".

CC @golang/release.

1
Answered Mar 05 '21 at 22:13
avatar  of dmitshur
dmitshur

It's possible that our changes in #44714 and #44389 caused longer compilation times due to differences in what is considered stale now. We might have to increase the compilation timeout to account for this.

1
Answered Mar 08 '21 at 18:30
avatar  of toothrot
toothrot

Change https://golang.org/cl/302770 mentions this issue: all: instrument build and vet time

1
Answered Mar 17 '21 at 21:56
avatar  of gopherbot
gopherbot

Change https://golang.org/cl/302771 mentions this issue: all: increase compile timeout to 10 seconds

1
Answered Mar 17 '21 at 21:56
avatar  of gopherbot
gopherbot

Change https://golang.org/cl/302769 mentions this issue: internal/metrics: add new package for recording metrics

1
Answered Mar 17 '21 at 21:56
avatar  of gopherbot
gopherbot

Change https://golang.org/cl/303469 mentions this issue: internal/metrics: fix detection of GCE environment

1
Answered Mar 19 '21 at 22:00
avatar  of gopherbot
gopherbot

I am going to re-open this. I want to fix it, but have been busy with other things.

1
Answered Apr 22 '21 at 14:54
avatar  of toothrot
toothrot

@89z FYI, the linked snippet does pass for me after our changes, but still occasionally fails: https://play.golang.org/p/nf79uLXs5-b

Modules by default impacted our caching strategy for dependencies on the playground, and we've not figured out the best way to resolve that yet.

1
Answered Apr 22 '21 at 14:56
avatar  of toothrot
toothrot

Change https://golang.org/cl/337010 mentions this issue: all: fix build timeouts for std dependent snippets

1
Answered Jul 23 '21 at 18:46
avatar  of gopherbot
gopherbot

@89z seems like you identified a real problem which the team is putting real effort into fixing. Ongoing bugs should be tracked by open issues; therefore, I don't see why we should close this issue until the problem is fixed (which seems imminent). If you "lack interest" in this issue, you are welcome to just stop interacting with it.

Additionally, multiple merged and in-progress CLs already reference this issue number, so switching to a new issue now just makes the history harder to follow.

1
Answered Jul 23 '21 at 18:56
avatar  of cespare
cespare

@cespare OK fair enough. I respect you because of your comments on Go generics [1], so whatever you say.

  1. https://github.com/golang/go/issues/45955#issuecomment-832355311
1
Answered Jul 23 '21 at 19:05
avatar  of 89z
89z

@89z You should be able to click on the "Unsubscribe" button over on the right if you no longer care about this issue. Thanks.

1
Answered Jul 23 '21 at 19:06
avatar  of ianlancetaylor
ianlancetaylor

The playground should deploy shortly, and I'll update here after verifying this was fixed.

1
Answered Jul 23 '21 at 20:21
avatar  of toothrot
toothrot