You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a minor timeout bug in Reactor affecting unit-test stability, real-world impact is probably minimal.
To Reproduce
Reduce first_data_timeout from 2 to 0.01 in test_timeout_in_data_phase (just to reproduce the issue quicker- the bug can still affect the existing test):
# We have to be sure to remove it from the timeout
# list or we'll accidentally close the socket when
# it's in use!
ifc.timeout_at
@mutex.synchronizedo
@timeouts.deletemon
end
end
However, the object is only actually moved from the reactor to the thread-pool when c.try_to_finish is true (when the header / body is fully buffered):
This leaves the edge-case where an object becomes readable but try_to_finish returns false, leaving the object in the reactor in a state where it will never time out.
The text was updated successfully, but these errors were encountered:
There is a minor timeout bug in
Reactor
affecting unit-test stability, real-world impact is probably minimal.To Reproduce
first_data_timeout
from2
to0.01
intest_timeout_in_data_phase
(just to reproduce the issue quicker- the bug can still affect the existing test):puma/test/test_puma_server.rb
Line 377 in 2ded685
Analysis
In
Reactor
, the monitor of theClient
object (c
) is removed from@timeouts
when the object becomes readable (has new data available to read):puma/lib/puma/reactor.rb
Lines 214 to 221 in 19b2a21
However, the object is only actually moved from the reactor to the thread-pool when
c.try_to_finish
is true (when the header / body is fully buffered):puma/lib/puma/reactor.rb
Lines 224 to 227 in 19b2a21
This leaves the edge-case where an object becomes readable but
try_to_finish
returnsfalse
, leaving the object in the reactor in a state where it will never time out.The text was updated successfully, but these errors were encountered: