Opened 3 weeks ago

Last modified 2 weeks ago

#23710 new defect

sched: channel_more_to_flush() is probably looking at the wrong queue

Reported by: dgoulet Owned by:
Priority: High Milestone: Tor: 0.3.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-sched
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


In the scheduler (both vanilla and kist), we do flush cells from the outgoing_queue to the outbuf using channel_flush_some_cells().

However, once we are done and to know what state the channel should be in, we use channel_more_to_flush() that looks at two things, the incoming_queue and the number of cells in the cmux.

It seems from my investigation that tor doesn't have this concept of "flushing cells from the incoming queue" so it doesn't make sense to look at it when we are trying to flush cells from the outgoing_queue to the outbuf so we can actually send() them.

Thus, this function should look at the outgoing_queue in my opinion although if I'm right in #23709, all this could change.

Child Tickets

Change History (1)

comment:1 Changed 2 weeks ago by dgoulet

Quick note: #23709 is a thing, the incoming_queue is always empty so it doesn't affect channel_more_to_flush() as it it basically always true that it is empty so it will never return 1 in the case of it being non empty.

Thus, it is safe for now to leave it that way.

Note: See TracTickets for help on using tickets.