relab / gorums

Gorums simplify fault-tolerant quorum-based protocols
MIT License
138 stars 14 forks source link

server: don't try to send replies after stream is closed #141

Closed johningve closed 3 years ago

johningve commented 3 years ago

The server-side request handlers send back responses through a finished channel. If the stream is cancelled, this channel can block and cause deadlocks or leak goroutines. To fix this, we can use a select statement to block until the response can be sent on the finished channel or until the stream context is cancelled.