-
Notifications
You must be signed in to change notification settings - Fork 583
goroutines leak in Reauthenticate #1977
Copy link
Copy link
Closed
Description
Following code in provider_client.go does not work as described:
// Report result to all other interested goroutines.
//
// This happens in a separate goroutine because another goroutine might have
// acquired a copy of `client.reauthmut.ongoing` before we cleared it, but not
// have come around to sending its request. By answering in a goroutine, we
// can have that goroutine linger until all responseChannels have been sent.
// When GC has collected all sendings ends of the channel, our receiving end
// will be closed and the goroutine will end.
go func() {
for responseChannel := range messages {
responseChannel <- err
}
}()Garbage collector does not collect such goroutines and they leak.
Here is a simple example which proves that:
https://play.golang.org/p/99jyHd9R_AX
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels