-
Notifications
You must be signed in to change notification settings - Fork 824
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
http2client: add interface 'close_conn()' #3160
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. Yes, we should better have an interface that allows us to gracefully shutdown HTTP/2 client-side connections.
In the long run, I think we should create a function that initiates the destruction of the entire h2o_httpclient_connection_pool_t
. That function should initiate close of all client-side HTTP/2 and HTTP/3 connections.
But that requires refactoring of existing code, because at the QUIC / HTTP/3-side, we have and use a function that closes all QUIC / HTTP/3 connections irrespective of them being server-side or client-side.
Therefore, I like the proposed approach of defining a function that closes each client-side HTTP/2 connection.
include/h2o/httpclient.h
Outdated
/** | ||
* close the connection | ||
*/ | ||
int (*close_conn)(struct st_h2o_httpclient__h2_conn_t *conn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we need to use a callback when the object that we are dealing is already an HTTP/2-specific type.
Maybe create an external function like h2o_httpclient__h2_initiate_close
?
Thanks for the review. |
@chenbd Thank you for your efforts on this PR. While I was receiving code, I started wondering about the Last Stream ID that we should send as part of the GOAWAY frame. IIUC this PR sends the largest Stream ID that the client initiated, I think that's incorrect. RFC 9113 states that "the GOAWAY contains the stream identifier of the last peer-initiated stream that was or might be processed on the sending endpoint in this connection". But then, the question comes to if there is benefit in sending a GOAWAY frame, when we never allow the server to push. The peer is never allowed to open a stream, therefore, there is no ambiguity regarding if we (running as a client) have processed anything. Therefore, I would like to ask the question: what is the purpose for sending a GOAWAY here? Unless there is a good reason to do so, I think I'm inclined to take no action here. I'm sorry for the inconvenience being caused but am looking forward to hearing your thoughts. Thank you in advance. |
Thanks for the review. |
No description provided.