- Python 2.7.9
- requests 2.17.3
We observe that when we call this from multiple threads (we run two to eight threads concurrently):
with requests.Session() as s:
s.put((apiserverUrl + str(id_num) + '/'), headers=headers,
auth=auth, data=jsonPayload)
That sometimes there is no client socket available, and it fails with a 10048 winsock error.
In some docs I reviewed, it appears that requests.Session() self closes, and in other places it indicates that it is held open for some default timeout.
What is the proper way to get the socket properly closed after each request?