Skip to content

runtime: mayMoreStackPreempt failures [1.20 backport] #60644

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

Closed
gopherbot opened this issue Jun 6, 2023 · 2 comments
Closed

runtime: mayMoreStackPreempt failures [1.20 backport] #60644

gopherbot opened this issue Jun 6, 2023 · 2 comments
Labels
CherryPickCandidate Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@gopherbot
Copy link
Contributor

@prattmic requested issue #55160 to be considered for backport to the next 1.20 minor release.

I believe this is a bug in https://go.dev/cl/7314062. (Yes, a 10 year old bug).

The "delicate dance" when a spinning M transitions to non-spinning is supposed to check all sources of work, but it doesn't check the global run queue: https://cs.opensource.google/go/go/+/master:src/runtime/proc.go;l=3084;drc=5b6e6d2b3d4d6877c86471209e249f1b6e36d0ca

gosched / mayMoreStack put the preempted goroutine on the global run queue, increasing the chance of failure (in addition to the extra stress it puts on the scheduler in general). Still, I am surprised this bug could go unnoticed for so long.

With that issue fixed, I can no longer reproduce this hang.

@gopherbot Please open backports to 1.20 and 1.19. This is a hang in the scheduler with no work around.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Jun 6, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jun 6, 2023
@gopherbot gopherbot added this to the Go1.20.6 milestone Jun 6, 2023
@prattmic
Copy link
Member

Upon further investigation, it seems that this can only cause hangs if asynchronous preemption is disabled and a goroutine is in an otherwise non-preemptible loop. If those don't apply, this bug will still drop parallelism (1 fewer P will run than should) but otherwise the program will continue to work.

Thus my current thinking is that we should not backport the fix, but I will revisit once we finish evaluating and merging the fix for tip.

@dmitshur dmitshur added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 28, 2023
@prattmic
Copy link
Member

prattmic commented Jun 30, 2023

We have decided to wait for 1.22 for this: #55160 (comment)

@prattmic prattmic closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2023
@golang golang locked and limited conversation to collaborators Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickCandidate Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants