It is not guaranteed that all queue lists are empty, because new requests
can be submitted from the callbacks. Changed this into a proper invariant
check, which asserts tbat the number of requests in sub-queues add up to
the total number in the main queue.
}
array_clear(req_arr);
- /* all queues must be empty now */
- i_assert(array_count(&queue->delayed_requests) == 0);
- i_assert(array_count(&queue->queued_requests) == 0);
- i_assert(array_count(&queue->queued_urgent_requests) == 0);
+ /* all queues should be empty now... unless new requests were submitted
+ from the callback. this invariant captures it all: */
+ i_assert((array_count(&queue->delayed_requests) +
+ array_count(&queue->queued_requests) +
+ array_count(&queue->queued_urgent_requests)) ==
+ array_count(&queue->requests));
}
/*