-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more information about http2 connection #1276
Comments
For H/2 you can use the connect-es/packages/connect-node/src/node-transport-options.ts Lines 39 to 53 in ba861a3
|
Is connect-es provides default NodeHttp2ClientSessionManager ? |
Yes, see the export |
How to gracefully shutdown htt2 connection (for example, server send me information do not use this endpoint) ? Maybe will be good implement disposable in transport? I need HTTP2 connection management tools to help me balance my clients. I open 20 connections at once and keep them updated if the server sends me information about new endpoints or if any of the endpoints become unavailable. I need to be able to safely close the connection and create new ones. For now, I can only createTransport, but I don't know how to gracefully shutdown them. |
It may be that the endpoint is available now, and after 5 minutes it is unavailable, and then it is available again. I need to effectively manage the current connections, understand in advance that the connection should not be used due to an error or loss of connection. |
The default session manager manages the connections according to HTTP/2 semantics (like goaway) and has settings to tweak ping/idle timeouts. You can look at the source code here. If the existing options don't cover your use case you can tweak it to do as you need. |
@srikrsna-buf I have a clear belief that |
Is your feature request related to a problem? Please describe.
CONTEXT
Within the YDB SDK, client-side load balancing is used. We send a single request to any database node, and it returns an array of available endpoints. Our task is to maintain connections to these endpoints as needed: close connections that we no longer need to use, create new connections to those that are missing, balance requests across these connections, and have the ability to send a request to a specific connection.
PROBLEM
Currently, it's not very clear how to properly close a connection (graceful shutdown), how to obtain the status of a connection, and how to receive notifications when a connection has been closed.
ONLY FOR HTTP2
Describe the solution you'd like
Extends Transport with EventEmitter, emit information about transport status changes, add current status of connection.
Additional context
https://ydb.tech/docs/en/recipes/ydb-sdk/balancing
https://blog.ydb.tech/client-side-balancing-in-ydb-89677b34fd5b
The text was updated successfully, but these errors were encountered: