You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Celery workers do not honour atexit() handlers, see celery/celery#8923. I'm trying a couple of different approaches to dealing with this, one being to use the Coverage API to dump the collected data as the worker runs. Since the worker runs my tasks, I can "easily" add the code to the end of my task function.
I therefore need incremental collection. I don't see an obvious solution using the current public API, but I do see the auto_load option on the constructor. Can it or the load() method be used to restart collection?
If not, then is the method in the stackoverflow.com exchange still current?
The text was updated successfully, but these errors were encountered:
I was able to close #1454 by implementing on-going dumping and restarting data collection. My current approach, in lieu of using the internal APIs used by the stackoverflow thread, is something like this:
ctx.coverage.stop()
ctx.coverage.save()
data_file = <some PID-based name with a monotonically increasing count as a suffix>
ctx.coverage = _coverage.Coverage(data_file=data_file, data_suffix='cov', cover_pylib=False, config_file=whatever)
ctx.coverage.start()
This assumes that the garbage collector will clean up after the old instance of ctx.coverage, and has the potential to create a lot of files. Hence the interest in whether auto_load or load() (or indeed some other API) could be useful. Ideally, something like:
Have you asked elsewhere?
The thread in https://stackoverflow.com/a/40518553/6332554 describes a way to "restart" data collection.
Describe your situation
Celery workers do not honour
atexit()
handlers, see celery/celery#8923. I'm trying a couple of different approaches to dealing with this, one being to use the Coverage API to dump the collected data as the worker runs. Since the worker runs my tasks, I can "easily" add the code to the end of my task function.I therefore need incremental collection. I don't see an obvious solution using the current public API, but I do see the
auto_load
option on the constructor. Can it or theload()
method be used to restart collection?If not, then is the method in the stackoverflow.com exchange still current?
The text was updated successfully, but these errors were encountered: