Skip to content
Myr

Drop connections from pool on connection exceptions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by Tom Christie · parent 6d35506 · Browse files · 1 file+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−1 removed

  • other:+6 added−1 removed

1 file+6 added−1 removed

modified:httpcore/connection_pool.py+6 added-1 removed
108 unmodified lines
109 ssl: typing.Optional[SSLConfig] = None,110 timeout: typing.Optional[TimeoutConfig] = None,111 ) -> Response:112 connection = await self.acquire_connection(request.url.origin, timeout=timeout)113 try:113 response = await connection.send(request, ssl=ssl, timeout=timeout)114 response = await connection.send(request, ssl=ssl, timeout=timeout)115 except BaseException as exc:116 self.active_connections.remove(connection)117 self.max_connections.release()118 raise exc119 return response120121 async def acquire_connection(122 self, origin: Origin, timeout: typing.Optional[TimeoutConfig] = None
39 unmodified lines