Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ames: minimum viable decrement underflow hotfix (#375)
We were incrementing the queue size counter conditionally, only for packets we want to forward. But for all packets, we were issuing a scry, and the callback would unconditionally decrement the queue size counter, leading to underflows. That, in turn, would result in vere thinking the queue was full when it wasn't. Here, we make the least invasive change that resolves that particular bug. There may or may not still be other things wrong with the logic/factoring around the packet queue and lane scries. f9e8542 changed the factoring here, making normal packet sending and forwarding take the same code path. ~~But also, even before that change, we were always sending the head of the packet queue to whatever lane scry result we got, which feels like it might not be right, _especially given that we don't even put the packet in queue when not forwarding_.~~ (edit: i think that was an incorrect reading of the code, we pass a pointer to the specific packet, not the whole queue.) I suspect we just don't want to scry for the lane in the normal sending codepath. We didn't do that before recent changes either. (edit: as currently written, we keep packets we want to send in memory until the scry gets back to us, without tracking them anywhere.) But I don't know the full context of the recent changes, so I'm only solving the specific symptom/bug here. Since this bug prevents forwarding from working reliable under certain circumstances, this should go out as a hotfix.
- Loading branch information