mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
162eae62bd
The context used there was a background context, which was not inherited from the stream. Thus when the client ends the stream (e.g. ^C `gobgp monitor global rib`), the context never completed, preventing the stop of most goroutines responsible for forwarding events. The only case where it completes is when an event gets generated, the transmit channel was closed, ending the chain of goroutines. Fix by inheriting the context from the stream, which completes when the stream ends, properly cleaning up all resources.