private-octopus / picoquic

Minimal implementation of the QUIC protocol
MIT License
540 stars 159 forks source link

Silly loops between test for repeat and pacing #1486

Closed huitema closed 1 year ago

huitema commented 1 year ago

Observing a failure mode of the "satellite preemptive" test. Application keeps getting polled, and the following happens:

1) check whether the next queued packet should be repeated now. Not ready, so set the wait time to repeat time.

2) check whether the next queued packet should be repeated now. ready, so:

3) wait for the pacing tokens to arrive, and repeat step 2

These means 1 or 2 round of simulation per packet waiting in the queue, without ever sending anything. This actually caused the test to fail, because there were many packets blocked in the queue.

The obvious fix to just not consume pacing tokens when not repeating packets breaks other tests.