Closed richardzilincikPantheon closed 1 year ago
And maybe it's also worth it to set the max workers of the Pool to 1, so we don't get inconsistent results from different scripts running simultaneously, or if the same script is being executed twice at the same time?
Yeah that's true. It will still be (and has been) possible to run one of the scripts while they're already running in a cronjob. That should be fixed in a separate PR.
Don't you think that writing job statuses to separate files would be better, so we can see if there were some jobs running while the container was rebuilt for example?
There's already logging in some of methods of the job runner. Would it be fine to just add logging to the places it's missing?
I found out that this won't work correctly with creating a pool in the server process. I'll implement running the processes differently.
Don't you think that writing job statuses to separate files would be better, so we can see if there were some jobs running while the container was rebuilt for example?
There's already logging in some of methods of the job runner. Would it be fine to just add logging to the places it's missing?
I think yes, I believe it would be better to add logging to the missing places
So after more investigation, it looks like a generally bad idea to use multiprocessing when using gunicorn. I didn't realize this before because the tests don't actually run against gunicorn. There is however a better way of doing things than what we have now, which is to use Celery to manage the communication with the message broker. I'll close this PR and create a separate one using Celery.
Codecov Report
20.35% <ø> (+0.75%)
89.36% <89.36%> (ø)
89.69% <92.30%> (-0.46%)
62.69% <100.00%> (-0.39%)
97.15% <100.00%> (+0.22%)
52.05% <100.00%> (-1.28%)
99.39% <100.00%> (+<0.01%)
99.03% <100.00%> (+0.01%)
98.71% <100.00%> (+0.01%)
91.70% <100.00%> (ø)
... and 1 file with indirect coverage changes