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

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

Closed
89z opened this issue Mar 5, 2021 · 10 comments
Closed

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

89z opened this issue Mar 5, 2021 · 10 comments

Comments

@89z
Copy link

@89z 89z commented Mar 5, 2021

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"
@dmitshur dmitshur added this to the Unreleased milestone Mar 5, 2021
@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Mar 5, 2021

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.

@dmitshur dmitshur changed the title playground: timeout running go build x/playground: timeout compiling trivial code that imports net/http Mar 5, 2021
@toothrot
Copy link
Contributor

@toothrot toothrot commented Mar 8, 2021

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.

@gopherbot
Copy link

@gopherbot gopherbot commented Mar 17, 2021

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

@gopherbot
Copy link

@gopherbot gopherbot commented Mar 17, 2021

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

@gopherbot
Copy link

@gopherbot gopherbot commented Mar 17, 2021

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

gopherbot pushed a commit to golang/playground that referenced this issue Mar 19, 2021
Move service code from sandbox/metrics.go to
internal/metrics/service.go. This will enable sharing of the code for
the playground front-end, allowing us to record metrics there as well.

For golang/go#44822

Change-Id: I592486cdffd62dd6b9cee6cadb56ddc027788f59
Reviewed-on: https://go-review.googlesource.com/c/playground/+/302769
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
gopherbot pushed a commit to golang/playground that referenced this issue Mar 19, 2021
This change adds a latency distribution for the build&vet stage, the vet
stage, and the run stage of a snippet handled by the compile handler.

For golang/go#44822

Change-Id: Icedce87492afadd6041efb05e6f0ed3cd12a01ba
Reviewed-on: https://go-review.googlesource.com/c/playground/+/302770
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
@gopherbot
Copy link

@gopherbot gopherbot commented Mar 19, 2021

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

gopherbot pushed a commit to golang/playground that referenced this issue Mar 22, 2021
appengine.IsAppEngine mistakenly returns false, as it relies on the app
being built with the appenginevm build constraint. This is not set,
as we're supplying our own Docker image.

The playground is always running either locally or on appengine. We can
rely on metadata.OnGCE being correct.

Other calls that are made to the appengine library either use the
metadata server or environment variables, and do not rely on a
constraint being set. They also panic if the metadata server is
unavailable.

For golang/go#44822

Change-Id: I1de5fda4bfd1e909f1fd54cc44770525827a9c1a
Reviewed-on: https://go-review.googlesource.com/c/playground/+/303469
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
gopherbot pushed a commit to golang/playground that referenced this issue Mar 22, 2021
This doubles our compile time to give us more room to figure out how to
optimize the module build path in the playground.

For golang/go#44822

Change-Id: I4f0153c9a835d18e0ab4e4af1b63bc52b4eebd52
Reviewed-on: https://go-review.googlesource.com/c/playground/+/302771
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@89z
Copy link
Author

@89z 89z commented Apr 21, 2021

closing for lack of interest

@89z 89z closed this Apr 21, 2021
Go Release Team automation moved this from In Progress to Done Apr 21, 2021
@toothrot
Copy link
Contributor

@toothrot toothrot commented Apr 22, 2021

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

@toothrot toothrot reopened this Apr 22, 2021
@toothrot
Copy link
Contributor

@toothrot toothrot commented Apr 22, 2021

@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.

@toothrot toothrot moved this from Done to Planned in Go Release Team Apr 22, 2021
@89z
Copy link
Author

@89z 89z commented May 27, 2021

closing for lack of interest

@89z 89z closed this May 27, 2021
Go Release Team automation moved this from Planned to Done May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
@toothrot @dmitshur @gopherbot @89z and others