007662d49e
The fundamental problem is that both drpc and grpc servers want to close the listener and they both want to ignore the error from Accept after the listener is closed. There's no way to do this in a race free way. Fortunately, the mux hands out listeners that can be independently closed. That means they can both do their own shutdown logic where they ignore the error, and then after they're closed, the code orchestrating the servers can close the listeners. The final weird bit is that the server's Close method is required to wait until the Run method has exited (or at least enough for the listeners to definitely be closed) because tests depend on that behavior, so we have to add some channels/mutexes/onces to ensure that Run has exited and that a new call can't start after Close is called. Change-Id: I7c4ef293f7963f83138815f51824fd5b8d09ce15 |
||
---|---|---|
.. | ||
common.go | ||
config.go | ||
interceptors.go | ||
server.go |