mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-06 00:02:08 -04:00
fixed the endless loop on exception for good
type check errors were sometimes causing the request loop to stall. This was due to it not being handled in pool, and the respective requests not being reaped. On exit, the session would try to close these connections, but they weren't available anymore, causing it to happen. We were already doing this for Interrupt, we're just extending it for all non-StandarError exceptions
This commit is contained in:
parent
805096b721
commit
091ab764c9
@ -37,13 +37,13 @@ module HTTPX
|
|||||||
|
|
||||||
@timers.fire
|
@timers.fire
|
||||||
end
|
end
|
||||||
rescue Interrupt
|
|
||||||
@connections.each(&:reset)
|
|
||||||
raise
|
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
@connections.each do |connection|
|
@connections.each do |connection|
|
||||||
connection.emit(:error, e)
|
connection.emit(:error, e)
|
||||||
end
|
end
|
||||||
|
rescue Exception # rubocop:disable Lint/RescueException
|
||||||
|
@connections.each(&:reset)
|
||||||
|
raise
|
||||||
end
|
end
|
||||||
|
|
||||||
def close(connections = @connections)
|
def close(connections = @connections)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user