Description
Specification
While working on #14 we discovered that during tests with a large amount of streams and data being sent concurrently. Readable streams would fail to end. So far as we could tell, random streams would fail to process a message from streamRecv
that had fin = true
. In these cases other streams would send a fin frame, end and clean up on both sides, all after the problematic stream should've done the same.
Since then we found a stop-gap solution where we send a single null byte with the finish message. Given that, we're reasonably certain that the problem is related to 0-length messages not being sent or processed event though fin
was set to true.
Normally a 0-length message is not sent but in the case of a finish message they should be. This functionality was added in this commit cloudflare/quiche@cc98af0.
Under normal conditions with low load. Sending fin frames with 0-length messages works fine. The problem only happens under higher loads during testing and even then, somewhat randomly. It's been hard to narrow down the specific conditions that cause the problem
To address this problem multiple things need to be done.
- Create a pure rust example that can reproduce the problem. This will be useful for the upstream issue
- Investigate the
quiche
source code for the problem. based on what I understand is happening. The problem is likely located on the receiving side with marking the stream as readable after it has received the 0-length finish frame. But only during message loads. - Post an upstream issue with the rust example and a possible solution. Sooner the better so they can address the problem and fix it ASAP.
For now we're using a work-around where we add data to the fin frame message. In this case a single null byte. This should mark the stream as readable regardless of an potential issues with 0-length fin frames.
Additional context
- Related Test connection multiplexing across multiple servers and clients #14
- cloudflare/quiche@cc98af0
Tasks
- 1. Create a pure rust example that can reproduce the problem. This will be useful for the upstream issue
- 2. Investigate the
quiche
source code for the problem. based on what I understand is happening. The problem is likely located on the receiving side with marking the stream as readable after it has received the 0-length finish frame. But only during message loads. - 3. Post an upstream issue with the rust example and a possible solution. Sooner the better so they can address the problem and fix it ASAP.