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 running program" error on official testable example #39016

Closed
psampaz opened this issue May 12, 2020 · 16 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@psampaz
Copy link
Contributor

psampaz commented May 12, 2020

What version of Go are you using (go version)?

go1.14.2 on Go playground

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Go playground

What did you do?

  1. I tried to run the testable example on https://golang.org/pkg/net/http/httputil/#DumpResponse

and it failed immediately with the error "timeout running program"

  1. I clicked the share button and I was redirected to https://play.golang.org/p/EULBr_niSNP

where the same code run successfully with out any errors

  1. I changed the text in bold:

w.Header().Set("Date", "Wed, 19 Jul 1972 19:00:00 GMT")

with random text just to have different code and clicked run again.

I tried the above multiple times:

Step 1 always fails
Step 2 always runs successfully
Step 3 sometimes fails and sometimes runs successfully

What did you expect to see?

Testable examples running successfully in all 3 cases described above

What did you see instead?

@gopherbot gopherbot added this to the Unreleased milestone May 12, 2020
@psampaz
Copy link
Contributor Author

psampaz commented May 12, 2020

possible related with #38855

@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 18, 2020
@cagedmantis
Copy link
Contributor

/cc @andybons @toothrot

@toothrot
Copy link
Contributor

I don't believe that #38855 is related to this issue, as that issue is specific to faketime, not to the timeout in running programs.

I don't see why this program should timeout reliably on the playground, or at all. The running time on the playground on my laptop is around 300ms. I'll see what I can figure out.

@toothrot
Copy link
Contributor

There are several places we can write that message. In local testing, it seems like the particular run timeout that is printing it is this one: https://github.com/golang/playground/blob/0298bc862cef82adf756a5d2c5b5b48920b84009/sandbox/sandbox.go#L357

This tells me that the sandbox container has the binary, got it on time, and the binary itself is just taking too long to execute for some reason.

@psampaz
Copy link
Contributor Author

psampaz commented May 18, 2020

@toothrot
Copy link
Contributor

This issue could be due to networking being disabled in sandbox containers in #25224, as even trivial tcp servers don't work on the playground in my testing.

@psampaz It's a nuanced difference, but this issue is not related to #38855. #38855 is caused by someone expecting a timeout inside of their program to occur, which will not happen as expected unless the fake clock is moved forward. On the playground, there is a slightly different version of the Go runtime ("faketime") that implements a fake clock, which helps make snippets repeatable, along with other features that are playground specific. https://golang.org/cl/192740 has the implementation, if you are curious.

This issue, #39016, is the program on the playground timing out, and never finishing execution. It's also a timeout, true. However, it is not a timeout inside the user's program, but a timeout of the playground waiting for the user program to finish.

The server references you posted are helpful, and also confirm that this is a generalized issue with networking in sandboxed containers.

@toothrot
Copy link
Contributor

Actually, the fact that it sometimes works leads me to believe it could be an issue with faketime, but certainly not in the same way as reported in #38855.

@yoursunny
Copy link

Maybe related: a simple program with both net.Pipe() and time.Sleep() fails in playground with "timeout running program".
Share link: https://play.golang.org/p/IoBh7drjhkT

package main

import (
	"net"
	"time"
)

func main() {
	net.Pipe()
	time.Sleep(time.Millisecond)
}

If I delete either line, the problem does not occur.
Despite the error, if I add other code to interact with the net.Conn object returned from net.Pipe(), they are functional.

@EduardTsoy
Copy link

It often fails even with the simplest Hello World:

@munapower
Copy link

I am getting the same message on the playground, while I am doing the go Tour. I am in the section where they explain Methods
image

@PierreVandeVyvre
Copy link

Same problem on Go Play Space https://goplay.space/ ...

@gmCrivelli
Copy link

Same problem on the Go Playground tour.

@LaevusDexter
Copy link

😐

@LaevusDexter
Copy link

The same with play.golang.org/compile

@toothrot
Copy link
Contributor

This was caused by a temporary outage and has been resolved (see #44537).

@PierreVandeVyvre
Copy link

PierreVandeVyvre commented Feb 24, 2021 via email

@golang golang locked and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

10 participants