mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
fix: do not apply timeout errors on inactive conns
when selector emits a timeout error, the full list of connections in the pool is traversed. This is in itself not very performant, but the problem is that the accounting is also done with connection which weren't selected, such as the inactive connections. So we skip this for them for now.
This commit is contained in:
parent
9aeaf437ef
commit
fde8ea3276
@ -554,6 +554,10 @@ module HTTPX
|
||||
ex.set_backtrace(error.backtrace)
|
||||
error = ex
|
||||
else
|
||||
# inactive connections do not contribute to the select loop, therefore
|
||||
# they should fail due to such errors.
|
||||
return if @state == :inactive
|
||||
|
||||
if @timeout
|
||||
@timeout -= error.timeout
|
||||
return unless @timeout <= 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user