Skip to content

Conversation

@kitaekatt
Copy link

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

  • UnixHTTPConnectionPool now accepts maxsize parameter and passes it to parent class
  • UnixAdapter now accepts pool_maxsize parameter (default 1 for backwards compatibility) and passes it to UnixHTTPConnectionPool

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.

UnixHTTPConnectionPool was not passing maxsize to the parent
HTTPConnectionPool, causing it to always use the default of 1.
This resulted in "Connection pool is full, discarding connection"
warnings when making concurrent requests through a Unix socket.

Changes:
- UnixHTTPConnectionPool now accepts maxsize parameter and passes
  it to parent class
- UnixAdapter now accepts pool_maxsize parameter (default 1 for
  backwards compatibility) and passes it to UnixHTTPConnectionPool

This allows users to configure larger connection pools for
concurrent request scenarios:

    adapter = UnixAdapter(pool_maxsize=10)
    session.mount('http+unix://', adapter)
@mupuf
Copy link
Collaborator

mupuf commented Dec 5, 2025

Looks good to me, and thanks for the great commit message and PR!

Copy link
Collaborator

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see at least one more in _new_conn()

@kitaekatt
Copy link
Author

_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.

@webknjaz
Copy link
Collaborator

webknjaz commented Dec 7, 2025

Ah, right. Could you add a test for the change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants