-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
In Streamer.Stream(), there is an inherent concurrency issue, because the Connection.Closed flag is used to determine if the Connection.Queue channel needs to be closed or not:
restreamer/streaming/streamer.go
Lines 334 to 336 in 6a701ca
| if !request.Connection.Closed { | |
| close(request.Connection.Queue) | |
| } |
If someone closes the channel, the flag update is delayed, and a concurrent goroutine may try to close it again:
restreamer/streaming/connection.go
Line 132 in 6a701ca
| conn.Closed = true |
As quick&dirty workaround, recover() can be used, but it would be better to remove this flag and find a different way to signal closure and trigger cleanup.