go-driver
go-driver copied to clipboard
Goroutines leak in notify listener
Here is sending message for notify listeners: https://github.com/arangodb/go-driver/blob/master/vst/protocol/message.go#L58
Here are 2 reads from this channel:
- https://github.com/arangodb/go-driver/blob/master/vst/connection.go#L169
- https://github.com/arangodb/go-driver/blob/master/vst/authentication.go#L143
If readers doesn't read from channel, then write is locked and goroutine leak.
In 1st case it's possible when context.Done()
In 2nd case - when conn.Send
returns error
Possible solutions:
- Write to channel with context + select(such as read in 1st)
- When context is done while read, then continue read channel in goroutine then just log or smth