Description
When a child channel is "closed while open", we deliver any pending reads into the Channel
:
swift-nio-http2/Sources/NIOHTTP2/HTTP2StreamChannel.swift
Lines 818 to 821 in 39ed0e7
After that, we actually close the stream:
swift-nio-http2/Sources/NIOHTTP2/HTTP2StreamChannel.swift
Lines 823 to 829 in 39ed0e7
The problem with this is that these reads may trigger some writes. Those writes are doomed to fail, but we let them run into the parent channel before they fail. We could fail them faster by making the stream channel state a little more complex. This will also prevent errors triggered by these writes from having to propagate through the parent channel, which can trigger weird follow-on issues.