grpc-swift icon indicating copy to clipboard operation
grpc-swift copied to clipboard

Synthesise status when stream closes unexpectedly

Open gjcairo opened this issue 1 year ago • 0 comments

Motivation

When the stream closes unexpectedly (the H2 stream channel becomes inactive, an error is fired through the pipeline, or we receive a RST_STREAM frame), the client-side inbound sequence either finishes or throws an error. To make it easier for higher layers to retry, we want to synthesise a Status instead.

Modifications

  • On the client side, write a Status when one of the aforementioned unexpected closures happens.
  • On the server side, make sure we're always firing an error when closing unexpectedly. I'm not sure this is the right thing to do though.
  • On both, make sure we transition the stream state machine to closed.

Result

Inbound sequence now returns a Status instead of finishing/throwing

gjcairo avatar Jun 28 '24 13:06 gjcairo