Answer the question
In order to leave comments, you need to log in
What if gunicorn doesn't close all child threads?
Given: Python 3.7, flask webserver under gunicorn.
For each request, gunicorn creates a separate thread (threading module), but for some reason gunicorn does not close all threads after the code has been executed. The result is this picture:
[item.name for item in threading.enumerate()]
['MainThread', 'WorkerThread1', 'WorkerThread2', 'WorkerThread3', 'WorkerThread4', 'WorkerThread5', 'WorkerThread6', 'WorkerThread7', 'WorkerThread8', 'WorkerThread9', 'WorkerThread10', 'WorkerThread11', 'WorkerThread12', 'WorkerThread13', 'WorkerThread14', 'WorkerThread15', 'WorkerThread16', 'WorkerThread17', ...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question