Skip to content

"UNIMPLEMENTED: unknown service" when available service changes #993

@sangaman

Description

@sangaman

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.

  1. Start a gRPC server providing ServiceA.
  2. Start a node process, create a client for ServiceA and perform a call.
  3. Restart the gRPC server and have it provide ServiceB on the same port.
  4. Close the ServiceA client in the same node process and create a client and make a call against ServiceB.
  5. Disable ServiceB on the server and enable ServiceA on the same port.
  6. Close the ServiceB client in the same node process and recreate a client and make a call against ServiceA.
  7. 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions