containers / containers/winquit
Correct use of `GetCurrentMessageLoopThreadId` is racy
- Dominant language
- Go
- Stars
- 13
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
`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 https://github.com/containers/winquit/blob/d75df78ca4d59389906473a4a502bfcd509c8a94/pkg/winquit/server_windows.go#L64-L68), 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: https://github.com/containers/gvisor-tap-vsock/pull/433
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.