Test Details Overview

Keep requests queued while their channel has no room instead of dropping them after the pop (#5248)

* Split the fair queue's declarations from its definitions

The class body of fair_queue keeps declarations with one-line comments, every definition moves below the namespace under a banner per nested type, and the old doc comments are rewritten. The callback aliases are named by what they query, origin_size_query, origin_priority_query and origin_alive_query, instead of a _t suffix. next_batch pops while something is queued and the batch has room, like the other batch pops, instead of counting first.

clear also resets the cursor and the size counter, which it left dangling and stale; nothing calls it. No other behavior changes.

* Let the fair queue serve only the origins a predicate accepts

next_ready and next_ready_batch pop like next and next_batch but skip the origins a per-call predicate refuses, leaving their requests queued. A round that finds nothing ready returns nothing and leaves the cursor and share count where they were, so the next attempt resumes the same round. The existing next and next_batch keep their contracts.

* Let test_channel report a saturated traffic type and close

saturate and unsaturate make max () report a traffic type as full, and close () now takes effect so alive () turns false. Both are needed to exercise consumers that defer or discard requests by the state of their channel.

* Keep vote reply requests queued while their channel has no room instead of dropping them

The replier popped a batch and then dropped every request whose channel was at the soft limit for vote replies, wasting the fairness turn and the accepted request. It now pops only requests whose channel has room, leaving the others queued under the per-channel cap, and waits 100 ms when every queued request is waiting on a full channel. Requests of a dead channel come out at once and are discarded without a lookup, so a closed channel cannot pin its queue.

channel_full now counts those pauses rather than dropped requests, and channel_dead counts the discarded requests.

* Keep bootstrap requests queued while their channel has no room instead of dropping them

The server popped a batch and then dropped every request whose channel was at the soft limit for bootstrap responses, wasting the fairness turn, the accepted request and the rate limiter budget spent on it. It now pops only requests whose channel has room, leaving the others queued under the per-channel cap, and waits 100 ms when every queued request is waiting on a full channel. The rate limiter charges the requests actually served, after the pop, so those pauses spend no budget. Requests of a dead channel come out at once and are discarded without a lookup, so a closed channel cannot pin its queue.

channel_full now counts those pauses rather than dropped requests, and channel_dead counts the discarded requests.

* Let the fair queue replace an origin's oldest request when its queue is full

push_evicting queues like push, but a full origin makes room by dropping its oldest request, which comes back to the caller so it can be counted; an origin with a cap of zero still refuses. The lookup that creates an origin's queue on first use is shared by both pushes.

* Answer the most recent vote reply requests of a full channel instead of the oldest

A channel at its queue cap refused every further request, so once a saturated channel drained the replier answered the oldest requests it had. It now takes the newcomer in place of the oldest queued request and counts the evicted one as overfill with its hash count. The dispatcher counts an inbound drop only for a request the replier refuses, which a channel allowed to queue nothing still does.

* Answer the most recent bootstrap requests of a full channel instead of the oldest

A channel at its queue cap refused every further request, so once a saturated channel drained the server answered the oldest requests it had, which the client had most likely given up on. It now takes the newcomer in place of the oldest queued request and counts the evicted one as overfill under its request type.

* Wait 25 ms instead of 100 ms for room on channels

The two reply servers pause when every queued request sits behind a full channel, and the three broadcasters pause when the network is short of capacity. Each of them slept 100 ms between checks. The pause only matters when nothing else wakes the sender, and it adds at most one interval on top of the channel draining, while a check costs one soft limit read per channel, so a shorter pause is cheap. Room comes back as writes complete, within milliseconds.

The interval is one constant, nano::transport::capacity_wait, so the five sites agree and the next change is one line.

The capacity warnings of the two rebroadcasters move from every 5 s to every 15 s, the cadence the vote generator already had.

__________

Type: commit

Hash: 0cee1269774f7bfaf5706248a765fdf80eb4f7e0

Created: yesterday

__________

gr0v1ty/nano-node:0cee1269774f7bfaf5706248a765fdf80eb4f7e0

Test Results

Test Case Status Duration Median Deviation Log Graph
5n4pr_conf_10k_bintree FAIL N/A N/A GitHub job logs -
5n4pr_conf_10k_change FAIL N/A N/A GitHub job logs -
5n4pr_conf_change_dependant FAIL N/A N/A GitHub job logs -
5n4pr_conf_change_independant FAIL N/A N/A GitHub job logs -
5n4pr_conf_send_dependant FAIL N/A N/A GitHub job logs -
5n4pr_conf_send_independant FAIL N/A N/A GitHub job logs -
5n4pr_rocks_10k_bintree FAIL N/A N/A GitHub job logs -
5n4pr_rocks_10k_change FAIL N/A N/A GitHub job logs -