0

I'm using python3 requests library to send simple http post requests. Below is the change which solves my purpose. But after sending 1000+ requests, getting resource busy or device busy error and sometime too many open files. Upon investigation, I see lot of socket file descriptors are left open. On further investigation, I see these socket file descriptors are left open by python3 requests library.

response = requests.post(url, payload, timeout=30)
response.text

I tried passing headers = {'Connection': 'close'}, but still the the sockets are open. Looks like it's an issue with underlying urllib3 library. Is it a known issue? and fixed? if it is fixed, which version has a fix?

aminrd
  • 3,728
  • 3
  • 17
  • 34
Venkat
  • 1
  • Could be related to this question? https://stackoverflow.com/questions/18466079/change-the-connection-pool-size-for-pythons-requests-module-when-in-threading – Gonzalo Odiard Mar 04 '22 at 20:48

0 Answers0