backchannel: do not block when closing client
In gitlab#351425 (closed) we learned that when grpc-go reconnects to a Gitaly server, it synchronously closes the old connection. That makes it important that we do not block while closing a connection. This commit removes code that waited for the backchannel client-side server to close while closing a client connection. Instead of waiting, we just propagate the close to the yamux sesion.
The problem this solves can be reproduced as follows:
- Make a
git ls-remote
request via HTTP to a GitLab instance - Freeze the Gitaly server process Workhorse is connected to (this may be Praefect) with
kill -STOP
- Make a second
git ls-remote
request
The second request will hang for minutes. This is because grpc-go in Workhorse detects that the connection is broken, tries to reconnect, but then blocks waiting for the backchannel client connection to close.
Edited by Jacob Vosmaer