[tor-bugs] #24449 [Core Tor/Tor]: sched: KIST scheduler should handle limited or failed connection write

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Nov 27 22:03:33 UTC 2017


#24449: sched: KIST scheduler should handle limited or failed connection write
------------------------------+--------------------------------
     Reporter:  dgoulet       |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.3.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  tor-sched
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 This is specific to KIST as far as I can tell.

 KIST will flush cells one by one from the circuit queue to the outbuf as
 long as the socket TCP limit allows it. Now, I've seen on a normal relay
 using KIST flushing '''164''' cells at once onto the outbuf. This is fine,
 it is only 83968 bytes.

 Then, at some point, it will write to the kernel with
 `connection_handle_write(conn, 0)`. The returned value is ignored which is
 not good because that function will limit the number of bytes written to
 up to a maximum of ~8KB (~16 cells):

 {{{
   max_to_write = force ? (ssize_t)conn->outbuf_flushlen
     : connection_bucket_write_limit(conn, now);
 }}}

 We do not call the function with `force = 1` which would make us flush
 them all. And we probably don't want to do that because force=0 is
 respecting our bandwidth rate if any.

 So, I think we might want to have KIST to be a bit more wise here and on a
 per-channel basis, decide on a maximum number of cells it can flush which
 would respect our bucket size and priority?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24449>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list