@grpc/grpc-js & SO_REUSEPORT
See original GitHub issueIs 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:
- Created 3 years ago
- Reactions:1
- Comments:10 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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()
andaddService(...)
) 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?
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.