Repository navigation
Bessemer v1.0.0rc7
Pre-releaseSeventh release candidate for 1.0. It is 1.0.0rc6 with its adaptive admission
corrected and two older faults fixed: a sync handler that could run after its
request had been answered, and a refused request head whose answer Windows
could lose. CPU-bound sync handlers are no longer refused on a busy or a
paused host. A loop blocked in its handlers is refused whether or not other
threads of the process are at work, and stays marked for as long as it is
inside what made it late. A fixed max_in_flight no longer costs four system
calls a request. Two things change for an application that sets
nothing. A loop blocked by handlers that each run for longer than 20 ms now
refuses new requests throughout, where it refused them in gaps or, on the
Rust event loop, not at all. And a blocked loop beside threads that use
between a quarter and a half as much CPU as it spends blocked is no longer
refused, where 1.0.0rc6 refused it. The 1.x API freeze holds and nothing is
added to it. The evidence is in
production readiness.
Fixed
- Adaptive admission no longer requires CPU-bound handler threads to receive
half a host core before their work can explain a delayed loop. It compares
their recorded CPU work with the loop's own work, avoiding false overload
refusals when a busy host stretches GIL waits. Invalid clock samples still
count as delay, and genuine loop overload, fixed limits and request deadlines
remain bounded. - A loop blocked in its handlers is refused while other threads of the
process work. With the work of other threads judged by its amount alone,
which is the entry above before it was released, any late request was
excused once they had used 5 ms of CPU and twice the loop's: a thread of
the application using a twentieth of a core was enough for a loop asleep in
every handler never to be refused. The loop now also keeps the wall-clock
time it spends running request handlers, and other threads excuse a wait
only if they used at least a quarter as much CPU time as that, over the
request's own wait and over the whole run of late requests it would end.
CPU work added up across short samples must also have gone on through the
request's own wait, not only before it. CPU-bound sync handlers are still not
refused, on a busy or a paused host. What this does not see is listed under
adaptive request admission. - A loop marked congested stays marked while it is inside the batch in which
it last started a request late, and for four target intervals after that
batch ends. The four intervals were counted from the late request itself,
so under handlers that each block the loop for longer than they last
(20 ms at the default timeout) the mark lapsed before the next request was
started. Such a loop was refused only in the gaps, and on the Rust event
loop a burst to it was not refused at all. Every release since 1.0.0rc2
has this. - A request started on time no longer ends a run of late requests when a
late one was counted earlier in the same batch. A batch takes requests in
the order they came, so its last ones may be on time only because they came
just before it. With handlers that block after their firstawait, every
batch could end that way, and a loop blocked nearly all the time was never
refused. - A sync handler waiting for a pool thread no longer starts after its request
has been answered, by its deadline or because its client went. The event
loop tells it of the cancellation when it next takes its batch, and a pool
thread freed before then started the call anyway, so its work was done for
nobody. The pool thread now asks whether anyone is still waiting before it
starts the call. 1.0.0rc5 and 1.0.0rc6 both have this, on a busy host. - A request head refused before it had ended, for more headers than allowed,
is answered while the rest of it arrives. The connection closed straight
after its error response, so what the client sent next reset it; on
Windows the client could lose the431and see a reset instead. After an
error response a connection now keeps reading what its client sends, for at
most 500 ms and 64 KiB, until the client closes. - A worker with an explicit
max_in_flightno longer reads two CPU clocks
for every request. A fixed cap has no delay target, so since 1.0.0rc6 each
of its requests was late the moment it was queued, and took the readings a
late request takes before being ignored: fourclock_gettimesystem calls
a request in 1.0.0rc6. Which requests were admitted was not affected. - Requests queued before CPU tracking starts can use subsequent CPU readings
to explain continued contention. Batch mark numbers are no longer reused
after a healthy period. - Queue delay is sampled when each request starts, without counting its own
batch's handler execution again after the batch finishes.