-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
os/signal: deadlock detection fails when os/signal is included #21576
Comments
This is hard to fix. A program that has any active |
@ianlancetaylor understood, but as is - even if i call no functions explicitly (such as when the code is in dev/debug mode), the init functions are active here this means to 'enable' deadlock detection i need a code-change where i remove all references to i don't have a clean solution to propose here, i'm just highlighting a build/debug quirk that came up |
I would be willing to consider a CL that starts the goroutine only when |
Change https://golang.org/cl/101036 mentions this issue: |
I stumbled upon this issue as I was having dinner so I've mailed https://go-review.googlesource.com/#/c/go/+/101036. Thank you very much for the report @cwedgwood and @ianlancetaylor for the solution! |
resolved some time ago, closing |
This issue hasn't yet been solved. CL fixing it will be merged soon. |
I mailed CL https://go-review.googlesource.com/c/go/+/101036 for this change, PTAL. |
Hi, Just curious to know is "ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)" in the associated testcase supposed to kill the background 'go run' after 5 seconds (if without the fix from @odeke-em , it gets stuck there with my dev. environment? If reducing the time-out value, say to 100 millisecond, the background go program could be killed, what's behind the difference? Thanks. |
Too low of a deadline and it could become a flake during tests, too high of
a deadline and it could stall building the Go tree and running other tests.
5seconds is a heuristic that I thought was a decently good enough time for
go run to have successfully started. Makes sense?
Thank you.
…On Wed, Oct 9, 2019 at 7:19 AM Shawn ***@***.***> wrote:
Hi,
Just curious to know is "ctx, cancel :=
context.WithTimeout(context.Background(), 5*time.Second)" in the associated
testcase supposed to kill the background 'go run' after 5 seconds (if
without the fix from @odeke-em <https://github.com/odeke-em> , it gets
stuck there with my dev. environment?
If reducing the time-out value, say to 100 millisecond, the background go
program could be killed, what's behind the difference?
Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21576?email_source=notifications&email_token=ABFL3V4H5PRNFWMLMLECDATQNW43NA5CNFSM4DYB346KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAXRJBA#issuecomment-539956356>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABFL3V6KJTLCIQ7IB76BQ53QNW43NANCNFSM4DYB346A>
.
|
Thanks @odeke-em . Furthermore, without your change is the background 'go run' supposed to be killed after 5 seconds due to time-out? |
go1.8, go1.9-rc2
linux amd64 & go playground
including
os/signal
breaks deadlock detection:or see https://play.golang.org/p/-KF7aAeIhS as it happens there as well
this hangs
without
os/signal
included we get the expected deadlock detection messageThe text was updated successfully, but these errors were encountered: