Open ShaheedHaque opened 6 years ago
I tried to debug this, and noticed that the shell seems to think that the configured beat schedule is empty:
$ celery -A myapp shell
...
>>> celery.conf.beat_schedule
{}
Could it be that the "inspect scheduled" command only considers (statically) configured schedules?
OK, this is weird. I start beat like this:
celery -A paiyroll beat --scheduler django_celery_beat.schedulers:DatabaseScheduler -l info --detach
(I've omitted --pidfile, --logfile and --workdir), and yet, the shell shows this:
$ celery -A myapp shell
>>> pprint.pprint({k:v for k,v in celery.conf.items() if k.startswith('beat')})
{'beat_max_loop_interval': 0,
'beat_schedule': {},
'beat_schedule_filename': 'celerybeat-schedule',
'beat_scheduler': 'celery.beat:PersistentScheduler',
'beat_sync_every': 0}
Now, I think the system is working because when I submit scheduled tasks (using the django CrontabSchedule and PeriodicTask model APIs), they show up in the admin and run as expected. Is the problem that the running copy of beat takes its cue from the command line, whereas everything else is using the static configuration?
I changed the static configuration to look like this, but 'inspect scheduled' still shows nothing:
$ celery -A myapp shell
>>> import pprint;pprint.pprint({k:v for k,v in celery.conf.items() if k.startswith('beat')})
{'beat_max_loop_interval': 0,
'beat_schedule': {},
'beat_schedule_filename': 'django',
'beat_scheduler': 'django_celery_beat.schedulers:DatabaseScheduler',
'beat_sync_every': 0}
>>>
now exiting InteractiveConsole...
$ celery -A myapp inspect scheduled
-> celery@baba: OK
- empty -
Light dawns...as per StackOverflow:
The celery inspect module appears to only be aware of the tasks from the workers perspective
So what's needed is a new command, possibly 'inspect periodic' which queries Beat for the ~scheduled~ periodic tasks. Is that right? If so, the relevant patch would be to the Celery project, not Beat, right?
Without knowing much... I would assume the following:
beat
will have to expose its current scheduleflower
will then need to look at the beat
"workers" when reading these for the web app.Yes. To expand on the Beat part, obviously the nominal schedule is in the "external" database, so the request here is about querying the beat process' "internal" database for the actual state of the system.
I think the Flower part is separate, needed for the flower issue specifically.
It would actually be great to see the periodic tasks. Have you found any other way to see them so far?
No. That was a primary reason for ditching my use of beat.
Any updates on this?
I'd be willing to give it a shot, but won't have anything ready before end of next week. If anyone is willing to, please go for it!
On Fri, Jul 12, 2019, 5:57 PM otniel notifications@github.com wrote:
Any updates on this?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/celery/django-celery-beat/issues/126?email_source=notifications&email_token=AAGKLDPLNHRQELX2HUPBDBLP7D45BA5CNFSM4EQEGFL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ27F4Y#issuecomment-511046387, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGKLDLYFJ6K35LHLAMXJQTP7D45BANCNFSM4EQEGFLQ .
+1 for this feature. We cannot see scheduled tasks in things like flower. This is obnoxious as we are unable to see results in flower and are forced to assign results to our database to see the results.
Part of celery 5's design goals is to enable this. Unsure if/when, but it's up for improvement.
Part of celery 5's design goals is to enable this. Unsure if/when, but it's up for improvement.
we might have to introduce some celery 5 stuff in celery 4.x branch which will not disrupt the API's much.
For this portion (excluding those who do the debugging to understand what pieces need to change in the current design to make it work), do we have any partially illuminating docs? I'd imagine this isn't super challenging. We would need to ensure the pidbox system is running, and write logic to "convert" the beat pending task "queue" so that it will respond to the active & queue etc commands, at the very least.
No. That was a primary reason for ditching my use of beat.
What alternative are you using currently?
On Sat, 13 Jun 2020, 07:34 vumaasha, notifications@github.com wrote:
No. That was a primary reason for ditching my use of beat.
What alternative are you using currently?
I use systemd's timer units. That is in preference to cron, on essentially the same basis as discussed here, which is that systemd has a cleaner management story.
—
You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/celery/django-celery-beat/issues/126#issuecomment-643579029, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFHWKPB4DNIXC2AAU3Y4GLRWMMYDANCNFSM4EQEGFLQ .
I tried to debug this, and noticed that the shell seems to think that the configured beat schedule is empty:
$ celery -A myapp shell ... >>> celery.conf.beat_schedule {}
Could it be that the "inspect scheduled" command only considers (statically) configured schedules?
Thanks! This worked for me!
I have some periodic tasks defined which show up fine in the Django admin, and run. However, when I use the "inspect scheduled" command, I never get anything.
Note that the tasks were created dynamically using the Django models for CrontabSchedule and PeriodicTask; so they are not specified in the config. Is there some config that I am missing? This is what the slightly redacted "inspect report" says: