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

Correct use of GetCurrentMessageLoopThreadId is racy #2

Open
cfergeau opened this issue Nov 29, 2024 · 0 comments
Open

Correct use of GetCurrentMessageLoopThreadId is racy #2

cfergeau opened this issue Nov 29, 2024 · 0 comments

Comments

@cfergeau
Copy link

GetCurrentMessageLoopThreadId documentation says:

//  Returns [...] "0" if [a message loop] is not running. The latter indicates a mistake, 
// as this function should only be called after a call to one of the _OnQuit functions.

The _OnQuit functions create the message loop in a go routine (see

func initLoop() {
loopInit.Do(func() {
go messageLoop()
})
}
), so when these functions return, it's not 100% guaranteed that a message loop is running and that it has a thread id.

We hit that race in gvisor-tap-vsock with test failures when running in a gh actions runner: containers/gvisor-tap-vsock#433

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

No branches or pull requests

1 participant