-
Notifications
You must be signed in to change notification settings - Fork 126
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
CI occasionally times out #167
Comments
I ran into this recently. There is a thread safety issue with coordinating Disconnect and Connect. If the connection is closed either through Disconnect or the connection being closed by a lower level AND an immediate call to Connect occurs (say for something that wants to auto reconnect), then there is a period of time where a new go routine will get created https://github.com/digitalocean/go-libvirt/blob/master/libvirt.go#LL297C18-L297C18 while the old is still in place and then we will overwrite the channel that is in use here - https://github.com/digitalocean/go-libvirt/blob/master/libvirt.go#L305. It appears the use of a channel close as a barrier creates the race condition as the connection could go down and be re-established without a Disconnect completing. A sync.Mutex for graceful shutdown may need to be in place to guard against a Connect/Dial to an actively disconnecting instance. This design appears to existing in |
Chances are that this could also time out if you're lucky and run it on your local workstation with
go test -race
but I've only seen this crop up on CI runs and not on my machine (yet).In this case, it seems like a call to Libvirt.Disconnect is never returning. The goroutines labeled "semacquire" are kind of interesting but they don't have an indicator that suggests how long they've been in that state.
stack trace
The text was updated successfully, but these errors were encountered: