schubergphilis / towerlib

A python library to interface with ansible tower's (awx) api.
MIT License
43 stars 39 forks source link

Connection Pool configuration #97

Closed jitterjuice closed 2 years ago

jitterjuice commented 2 years ago

This PR implements changes required to safely set the default HTTP adapter when using threaded pool executors.

By default, the HTTP adapter in urllib3 will use 10 pool_connections and have a pool max size of 10. As towerlib has a pagination limit of 25, this eventually causes warnings to appear:

"Connection pool is full - discaring connection ".

By allowing the developer to choose the values of pool connections and max size, with a safe default where max_size == pagination_limit, towerlib can reduce the amount of warnings displayed.

costastf commented 2 years ago

Thanks, this is great!