Opened 3 months ago

Last modified 12 days ago

#24449 assigned defect

sched: KIST scheduler should handle limited or failed connection write

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

Description

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?

Child Tickets

Change History (3)

comment:1 Changed 3 months ago by dgoulet

Parent ID: #23993

comment:2 Changed 6 weeks ago by dgoulet

Owner: set to dgoulet
Status: newassigned

comment:3 Changed 12 days ago by dgoulet

Milestone: Tor: 0.3.3.x-finalTor: 0.3.4.x-final

No chance I can get this done in 033... It requires quite a bit of change in terms of interface and code flow.

Note: See TracTickets for help on using tickets.