fix: Support pool_maxsize parameter for concurrent connections
Summary
UnixHTTPConnectionPool was not passing maxsize to the parent HTTPConnectionPool, causing it to always use the default of 1. This resulted in noisy "Connection pool is full, discarding connection" warnings when making concurrent requests through a Unix socket.
Changes
-
UnixHTTPConnectionPoolnow acceptsmaxsizeparameter and passes it to parent class -
UnixAdapternow acceptspool_maxsizeparameter (default 1 for backwards compatibility) and passes it toUnixHTTPConnectionPool
Usage
This allows users to configure larger connection pools for concurrent request scenarios:
adapter = UnixAdapter(pool_maxsize=10)
session.mount('http+unix://', adapter)
Backwards Compatibility
Default value of pool_maxsize=1 preserves existing behavior. Only users who explicitly set a larger pool size will see different behavior.
Looks good to me, and thanks for the great commit message and PR!
_new_conn() creates individual connections, not pools. maxsize is a pool-level setting passed to HTTPConnectionPool.init(). The parent _new_conn() signature is just (self) with no pool config parameters.
Ah, right. Could you add a test for the change?
_new_conn()
Looking into urllib3's source, I'd say we should stop redefining its private method and set the ConnectionCls class attribute instead.
This is out of the scope here but I'd still block merging on having at least some regression test coverage.