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
Comments
possible related with #38855 |
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. |
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. |
The example in #38855 is this one https://golang.org/pkg/os/exec/#CommandContext and if you try to run it, it has the same behavior. Same for this https://golang.org/pkg/net/http/httptest/#Server https://golang.org/pkg/net/http/httptest/#NewTLSServer https://golang.org/pkg/net/http/httputil/#DumpRequest https://golang.org/pkg/net/http/httputil/#DumpResponse and I suppose many more |
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. |
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. |
Maybe related: a simple program with both package main
import (
"net"
"time"
)
func main() {
net.Pipe()
time.Sleep(time.Millisecond)
} If I delete either line, the problem does not occur. |
Same problem on Go Play Space https://goplay.space/ ... |
Same problem on the Go Playground tour. |
😐 |
The same with play.golang.org/compile |
This was caused by a temporary outage and has been resolved (see #44537). |
Thanks very much for your support !
From: alexander rakoczy [mailto:notifications@github.com]
Sent: 24 February 2021 17:02
To: golang/go <go@noreply.github.com>
Cc: Pierre Vande Vyvre <Pierre.Vande.Vyvre@cern.ch>; Comment <comment@noreply.github.com>
Subject: Re: [golang/go] x/playground: "timeout running program" error on official testable example (#39016)
This was caused by a temporary outage and has been resolved (see #44537<#44537>).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#39016 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASZHBSTAJTWJSQ4IFD6MTT3TAUPIDANCNFSM4M6WCSGQ>.
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
and it failed immediately with the error "timeout running program"
where the same code run successfully with out any errors
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?
The text was updated successfully, but these errors were encountered: