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:
HoneyryderChuck 2020-10-30 01:16:37 +00:00
parent 805096b721
commit 091ab764c9

View File

@ -37,13 +37,13 @@ module HTTPX
@timers.fire
end
rescue Interrupt
@connections.each(&:reset)
raise
rescue StandardError => e
@connections.each do |connection|
connection.emit(:error, e)
end
rescue Exception # rubocop:disable Lint/RescueException
@connections.each(&:reset)
raise
end
def close(connections = @connections)