stream: fix the map of streams leak#120
Conversation
In a connection, streams are added only, but not deleted. When replying to the last data, delete the stream from map. And delete operations require concurrency. Signed-off-by: wllenyj <[email protected]>
|
Ahh yes, thanks My original thought was to use a buffered channel to mark the removals to be handled in the receive go routine. The motivation being to avoid a locking data structure on the receive path. However, a flood of stream closing which fill up the buffer would likely make that solution unworkable. I'll try to consider other lock free ways we could handle this, but we should get this change in. |
|
@dmcgowan thanks. |
kzys
left a comment
There was a problem hiding this comment.
Looks good to me.
How did you notice the issue by the way? It would be great if we can write some autometed way to check that this part won't have leaks in future.
I added the test log locally. If we want to cover it by unit test, we need to save |
In a connection, streams are added only, but not deleted.
When replying to the last data, delete the stream from map.
And delete operations require concurrency.
Signed-off-by: wllenyj [email protected]