Opened 3 years ago

Last modified 8 months ago

#24449 new defect

sched: KIST scheduler should handle limited or failed connection write

Reported by: dgoulet Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-sched, 034-triage-20180328, 034-removed-20180328
Cc: pastly Actual Points:
Parent ID: #23993 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?

Child Tickets

Change History (8)

comment:1 Changed 3 years ago by dgoulet

Parent ID: #23993

comment:2 Changed 3 years ago by dgoulet

Owner: set to dgoulet
Status: newassigned

comment:3 Changed 3 years 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.

comment:4 Changed 3 years ago by nickm

Keywords: 034-triage-20180328 added

comment:5 Changed 3 years ago by nickm

Keywords: 034-removed-20180328 added

Per our triage process, these tickets are pending removal from 0.3.4.

comment:6 Changed 3 years ago by nickm

Milestone: Tor: 0.3.4.x-finalTor: unspecified

These tickets, tagged with 034-removed-*, are no longer in-scope for 0.3.4. We can reconsider any of them, if time permits.

comment:7 Changed 17 months ago by gaba

Owner: dgoulet deleted

Releasing some old tickets.

comment:8 Changed 8 months ago by teor

Status: assignednew

Change tickets that are assigned to nobody to "new".

Note: See TracTickets for help on using tickets.