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

runtime: sometimes 100% CPU spin during init phase in Go 1.14 with preemptive scheduler [1.14 backport] #37833

Closed
gopherbot opened this issue Mar 12, 2020 · 5 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Mar 12, 2020

@randall77 requested issue #37741 to be considered for backport to the next 1.14 minor release.

@gopherbot please open a backport issue to 1.14.1.

@randall77
Copy link
Contributor

@randall77 randall77 commented Mar 12, 2020

This issue causes binaries on Darwin (and possibly other OSes) to randomly hang, particularly on startup.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 18, 2020

Change https://golang.org/cl/223939 mentions this issue: [release-branch.go1.14] runtime: don't send preemption signal if there is a signal pending

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Mar 18, 2020

Approved. As this is a serious issue without any workaround.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 18, 2020

Closed by merging e577ba9 to release-branch.go1.14.

@gopherbot gopherbot closed this Mar 18, 2020
gopherbot pushed a commit that referenced this issue Mar 18, 2020
…e is a signal pending

If multiple threads call preemptone to preempt the same M, it may
send many signals to the same M such that it hardly make
progress, causing live-lock problem. Only send a signal if there
isn't already one pending.

Updates #37741.
Fixes #37833.

Change-Id: Id94adb0b95acbd18b23abe637a8dcd81ab41b452
Reviewed-on: https://go-review.googlesource.com/c/go/+/223737
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 0c0e8f2)
Reviewed-on: https://go-review.googlesource.com/c/go/+/223939
Reviewed-by: Austin Clements <austin@google.com>
@mholt
Copy link

@mholt mholt commented Mar 18, 2020

@randall77 And others, thank you very much!! I still encounter this issue dozens of times per day so needless to say I am thrilled it was made a priority and I can't wait for the Go 1.14.1 release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.