Yeah, this is an area we have some active desire to resolve.

The issue isn't so much the lack of backpressure as it is the fact that dropping an async sequence that contains NIOAsyncChannels is almost always going to lead to a crash, unless that async sequence is specifically designed to handle NIOAsyncChannels. That's because the sequence buffer is at risk of holding the NIOAsyncChannel when it is deinited, which will trigger deinit of the channel and this crash.

In the very short term, a solution that you can adopt is to wrap the NIOAsyncChannel into a class that, on-deinit, invokes the shutdown methods. This essentially restores the deinit-based cleanup for NIOAsyncChannel while it's inside the async sequence. You can then unwrap it on the other side.

In the longer term, we need to reconstruct how we pass NIOAsyncChannel objects around. The current thinking is that we'll need to replace the existing Bootstraps, and the existing HTTP/2 multiplexing API, to provide one that doesn't have this risk of being incorrectly held.

1 Like