So, if you do the following from the interactive shell, you will see that closing the adapters is not what you are looking for.
import requests s = requests.session() s.close() s.get('http://httpbin.org/get') <Response [200]> for _, adapter in s.adapters.items(): adapter.close() s.get('http://httpbin.org/get') <Response [200]> s.get('https://httpbin.org/get') <Response [200]>
It seems that this may be a mistake in the requests, but in general, closing the adapter should prevent you from completing additional requests, but I'm not quite sure that it will interrupt the current requests.
Looking at the HTTPAdapter (which supports both standard and standard adapters 'http://' and 'https://' ), the call that calls it will call clear in the urrllib3 base pool manager. From the documentation of this urllib3 method, you see that:
This will not affect in-flight connections, but they will not be re-used after completion.
In fact, you see that you cannot affect a connection that is not yet completed.
source share