circuit_resume_edge_reading_helper is highly unfair
See comments on #1298 (moved), particularly Roger's:
For example, notice how circuit_resume_edge_reading_helper() always walks the stream list in the same order, and stops when it's exhausted the circuit's package window. Whenever that "stop when package window is empty" case gets triggered, we're being unfair to the streams later in the linked list
And my:
That issue is also relevant, and worth fixing. Here are a couple of ways we could do it:
- We could only package a limited number of cells per stream at a time, and loop until all input data is packaged, or the queue is full.
- We could start at a different position in the list of streams each time.
- Some combination of the above. I think the answer is "some combination of the above", since the first one still technically favors older streams, and the second one (though technically fair) can produce "fairness" of a really choppy type.