FlorianREGAZ / Python-Tls-Client

Advanced HTTP Library
MIT License
660 stars 136 forks source link

No Respons or Dead Lock while sending request in sub-process #33

Open dusty-cjh opened 1 year ago

dusty-cjh commented 1 year ago

Env

MacOS M1 chip Python3.9, using the tls-client.dylib

Phenomenon

  1. When I call the dylib.request method in single main process, everything works well.
  2. But when I call the dylib.request in the sub-process created by Celery, the request call never return value. it just blocked forever.

Question

here is the original question link

I want to know how I could inspect deeper for this problem, since I just use the PyCharm Debugger, but which get stucked in the function entry point. I got no idea what the next step I should do.

Could you give me some advices ? Thanks a lot

darphiz commented 1 year ago

If anyone encounters a similar problem. for the correct operation of the tls-client library, you need to start the celery queue with the -P threads parameter

for example celery -A ProjName worker -l INFO -P threads