-
Notifications
You must be signed in to change notification settings - Fork 680
Description
Problem description
I am making calls to a gRPC server that sometimes switches the available service at a given host and port. If ServiceA
is active, attempting calls from ServiceB
will give UNIMPLEMENTED
errors as expected, and vice-versa.
However, if I start a node process and make a call against ServiceA
, then the server switches to ServiceB
and I make a call against that, if it switches back to ServiceA
I get UNIMPLEMENTED
errors on all calls. This is despite calling the close
method on the client for a given service before switching between services.
One weird thing is that when debugging this issue in VSCode, if I set a breakpoint while debugging the issue goes away as soon as the breakpoint is hit and I'm able to make calls to ServiceA
again.
Reproduction steps
In my case I am testing the code in https://github.com/ExchangeUnion/xud against a server running the code at https://github.com/lightningnetwork/lnd which provides both a WalletUnlockerService
as well as a LightningService
(services B and A above, respectively). I'll give generic steps below but can offer more specific steps if needed of what I'm actually doing to reproduce the problem. In my setup I can reproduce the issue every time.
- Start a gRPC server providing
ServiceA
. - Start a node process, create a client for
ServiceA
and perform a call. - Restart the gRPC server and have it provide
ServiceB
on the same port. - Close the
ServiceA
client in the same node process and create a clientand make a callagainstServiceB
. - Disable
ServiceB
on the server and enableServiceA
on the same port. - Close the
ServiceB
client in the same node process and recreate a client and make a call againstServiceA
. - The call will fail with an
UNIMPLEMENTED
error
Restarting the node process resolves the error, it can successfully make calls against ServiceA
again.
Environment
- Ubuntu 19.04 amd64
- Node 10.15.3 installed via nvm
- gRPC@1.21.1
Additional context
Some discussion specific to our project: