Comment 19 for bug 1282089

Revision history for this message
Florent Flament (florentflament) wrote :

@mouadino, I agree that since we don't use cookies, there
shouldn't be any issue when sharing a requests.session.Session
between users. However, we should consider that the default pool
size is 10 HTTP and 10 HTTPS connections (
https://github.com/kennethreitz/requests/blob/master/requests/adapters.py#L31
) and needs a bit of a hack to be customized.

Then if I understand, we have two possible options:
* Horizon manages a connection pool, and shares it between OpenStack
  clients;
* OpenStack clients are responsible for managing their connection
  pool (or sharing one), which is hiden to Horizon.

From my POV, the two options are acceptable. However, unless I find a
good reason to opt for the first option, I think that the second
option makes life easier to write applications that use OpenStack
clients.

As both of you mentioned, the requests.Session object can deal with
several different urls. So if we go with hiding the connection pool to
Horizon, we can just go with a variant of mouadino's first patch.

As for the option of beign able to disable connection pooling, I kind
of agree with mouadino (unless someone provides me with a good counter
argument).

So it appears that there's an architectural choice to be made
there. In the mean time, Jamie's quick fix
https://review.openstack.org/#/c/82007/ looks like a good temporary
fix..