Skip to content
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

Send GOAWAY on client shutdown #460

Closed
ejona86 opened this issue Dec 4, 2015 · 12 comments · Fixed by #7015
Closed

Send GOAWAY on client shutdown #460

ejona86 opened this issue Dec 4, 2015 · 12 comments · Fixed by #7015

Comments

@ejona86
Copy link
Member

ejona86 commented Dec 4, 2015

The HTTP/2 spec encourages sending GOAWAY before dropping the connection. GOAWAY is necessary for "graceful" shutdowns.

When error handling:

Endpoints SHOULD send a GOAWAY frame when ending a connection, providing that circumstances permit it.

In the GOAWAY frame description section:

Endpoints SHOULD always send a GOAWAY frame before closing a connection so that the remote peer can know whether a stream has been partially processed or not.

.

A GOAWAY frame might not immediately precede closing of the connection; a receiver of a GOAWAY that has no more use for the connection SHOULD still send a GOAWAY frame before terminating the connection.

When discussing connection management:

When either endpoint chooses to close the transport-layer TCP connection, the terminating endpoint SHOULD first send a GOAWAY (Section 6.8) frame so that both endpoints can reliably determine whether previously sent frames have been processed and gracefully complete or terminate any necessary remaining tasks.

@dsymonds
Copy link
Contributor

dsymonds commented Dec 4, 2015

Dupe of #147.

@ejona86
Copy link
Member Author

ejona86 commented Dec 4, 2015

#147 is server-side, this is client-side.

@pires
Copy link

pires commented Dec 30, 2015

Any update on this?

@shuaichang
Copy link

+1, currently seems there's no way to close a clientconn gracefully, the transport is not accessible from outside of clientconn, so it's not possible to send Goaway to the transport

@dfawley
Copy link
Member

dfawley commented Feb 8, 2018

@shuaichang is the current behavior causing problems for you? IIUC, this is a pretty minor issue in that it would allow the server to more quickly clean up when a client disconnects, but is not a high priority issue.

Maybe you're more interested in #1104?

@shuaichang
Copy link

We implemented a client conn cache and sometime need to evict some conn out of cache and close it, without a graceful Close method, we will have implement something based on timeout, which is sub-optimal comparing to the grpc transport.GracefulClose. Seems the function is there, but not exported out of the package

@dfawley
Copy link
Member

dfawley commented Feb 8, 2018

@shuaichang thanks for the explanation. That feature request is #1104, not this issue. This issue is about sending an HTTP2 GOAWAY frame before closing a connection, regardless of whether we allow existing streams on that connection to continue.

@shuaichang
Copy link

Cool, I'll +1 in that issue

@dv29
Copy link

dv29 commented Jan 7, 2020

Hi, I'd like to take a shot at it if its already not done. I'm new at go and learning. is it done?

@dfawley
Copy link
Member

dfawley commented Jan 7, 2020

No, this is not done. Feel free to send a PR or let us know if you have questions. Thanks!

@grpc grpc deleted a comment from stale bot Jan 7, 2020
@dv29
Copy link

dv29 commented Jan 28, 2020

Sorry for delayed reply, I'll get on it.

@aranjans
Copy link
Contributor

Hi I'd be interested in resolving this issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants