runtime: can preempt running G asynchronously by sending sigurg while asyncpreemptoff is set #38531
Comments
We could do let SIGURG not preempt if asyncpreemptoff is set. I wonder what is the reason behind this. Are you running a program that you don't want to be preempted and it also receives external SIGURGs? |
I don't have specific use case, i was checking how preemption is implemented and find this problem, however i think if somebody wants to use |
Change https://golang.org/cl/240121 mentions this issue: |
Backport candidate? Also the CL didn't include a test to verify that preemption is disabled... |
I don't think this needs backport. As @koushki noted, it doesn't seem to affect any real program (for now). |
And re the lack of a test for preemption disabled? |
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
)?go env
OutputWhat did you do?
While using
GODEBUG=asyncpreemptoff=1
if you send asigurg
sig to a thread, the scheduler will preempt the running G.then run it with asyncpreemptoff
now use the tid to send the sig
What did you expect to see?
Since we use
asyncpreemptoff=1
i expect the app shouldn't be finished!What did you see instead?
the program prints
Done!
The text was updated successfully, but these errors were encountered: