h2 icon indicating copy to clipboard operation
h2 copied to clipboard

Documentation: How to handle GOAWAY

Open eaufavor opened this issue 1 year ago • 2 comments

The problem: it is not clear what a stream should do when receiving a GOAWAY h2 error.

Per https://datatracker.ietf.org/doc/html/rfc7540#section-6.8

GOAWAY allows an endpoint to gracefully stop accepting new streams while still finishing processing of previously established streams

So say when h2::RecvStream.data() gets an GOAWAY error, should we terminate the stream with an error or should we ignore this error (and continue processing)?

eaufavor avatar Jan 17 '24 23:01 eaufavor

I guess it depends on the error code https://datatracker.ietf.org/doc/html/rfc7540#section-7, and up to the implementer to decide what to do.

dswij avatar Jan 19 '24 13:01 dswij

My question is how the APIs of this crate is designed regarding GOAWAY. For example if I get GOAWAY with NO_ERROR (graceful shutdown) when reading, should I just ignore it continue processing my request?

If that is true, what is the point of returning the such errors to streams, just FYI?

eaufavor avatar Jan 22 '24 19:01 eaufavor