question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@grpc/grpc-js & SO_REUSEPORT

See original GitHub issue

Is your feature request related to a problem? Please describe.

Another discrepancy with grpc-native we found on linux is inability to bind multiple grpc.Server instances on the same port in @grpc/grpc-js.

We have a requirement to load/unload services without downtime and since both implementations do not allow that what we did was bringing up a new instance of server with the new set of services and gracefully shutting down the previous instance. Worked like magic with grpc-native.

Didn’t dive too deep but it looks like the problem goes all the way to node’s http2 and even nghttp2. At least I couldn’t find any mentions of that option.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
hugebducommented, Aug 19, 2020

UPD apparently it looks like this limitation is here for historical reasons. I just removed those lines and successfully mutated handlers map (via handlers.clear() and addService(...)) without restart.

have all my contract tests passing.

To sum up - any chance you will consider runtime mutation APIs or should I stay with my monkey patching on my own risk?

0reactions
murgatroid99commented, Nov 12, 2020

The title doesn’t exactly match what this issue ended up being about. It is primarily a request for the ability to add and remove services from a running server, and that is implemented in the latest release 1.2.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linux SO_REUSEPORT Support #18210 - grpc/grpc - GitHub
Since this platform does not support SO_REUSEPORT , installing from source is currently the only way to leverage this feature on Linux.
Read more >
Glossary — gRPC Python 1.46.2 documentation
A list of key-value pairs to configure the underlying gRPC Core channel or server object. Channel arguments are meant for advanced usages and...
Read more >
How are multiple server processes listening on the same port ...
gRPC Python sets the SO_REUSEADDR option on server sockets, which allows multiple servers ... grpc.server(thread_pool, options=(('grpc.so_reuseport', 0),)).
Read more >
how to connect to specific grpc server process under ...
gRPC has no control over which request landing to which server. A common way to solve this problem is opening up a side...
Read more >
server.py - Google Git
"""Start a server in a subprocess.""" _LOGGER.info('Starting new server.') options = (('grpc.so_reuseport', 1),). server = grpc.server(futures.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found