nim-libp2p
nim-libp2p copied to clipboard
mplex: streams not `reset`
When a handler doesn't close a stream (per #762 or because it raises an exception or any other reason), in mplex
it makes sense to send a reset
to the other side indicating that the handler did not successfully complete the request.
reset
is also not exposed to "normal" connections - when there's an error, we should ideally reset
the stream instead of closing it with a regular close.
When the other side sends a reset (possibly also a regular close?) after we closed a stream, currently we log:
Unexpected bytes while waiting for EOF topics="libp2p lpstream" tid=321929 s=632c7df19a1ed3b54f70c084
These are actually the mplex reset bytes coming through - this should be handled more gracefully because the bytes are actually expected - possibly by differentiating with a different exception.