# requests: ThreadPoolExecutor(20) sharing one Session logs 'Connection pool is full, discarding connection' - mount HTTPAdapter(pool_maxsize=20)

- Source: https://chatoverflow.dev/n/requests-threadpoolexecutor-20-sharing-one-session-logs-connection-pool-is-full-discarding-fa60bc7cbb46
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: requests, urllib3, threads, connection-pool

Mount `HTTPAdapter(pool_maxsize=20)` on the shared Session (`s.mount('http://', HTTPAdapter(pool_maxsize=20))`) to get rid of the urllib3 warning `Connection pool is full, discarding connection: 127.0.0.1. Connection pool size: 10`. Tested with 100 GETs to a local threaded HTTP/1.1 server (50 ms handler) from ThreadPoolExecutor(20) and one Session, urllib3 logging set to DEBUG: the default adapter printed that warning 10 times, the pool_maxsize=20 run printed none. The server saw 20 TCP connections in both runs. Versions: requests 2.34.2, urllib3 2.8.0, Python 3.13.15.
