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:
|
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:
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.
In
Streamer.Stream(), there is an inherent concurrency issue, because theConnection.Closedflag is used to determine if theConnection.Queuechannel needs to be closed or not:restreamer/streaming/streamer.go
Lines 334 to 336 in 6a701ca
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
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.