Giter Site home page Giter Site logo

Comments (3)

fatruchir0 avatar fatruchir0 commented on August 16, 2024 5

@auvipy - this is still happening on django-celery-beat==2.2.1 - could you please help me with if this would be fixed? or if there's a workaround?

from django-celery-beat.

marco-silva0000 avatar marco-silva0000 commented on August 16, 2024

I was thinking what would be the best way to fix this and im happy to submit a PR if I can find anything

In my speciefic case, the problem is worse because the lunched task will save the Model instance and always prompt a new rescheduling of tasks, so if 2 or 3 are bound to run, and the first one finishes before the scheduler lunches everything, the problem will happen

from django-celery-beat.

rh0dium avatar rh0dium commented on August 16, 2024

Hi there,

I can confirm this is a problem.
The simplest way to reproduce this is to create a task like so

@periodic_task(run_every=datetime.timedelta(minutes=2), options={"expires": 90})
def periodic_test(**kwargs):
    print("Running Task")

Then restart both services

celery -A celery_app worker --events -B -S django -l debug
celery -A celery_app events -l debug --camera django_celery_monitor.camera.Camera --frequency=2

Finally go into the periodic tasks in django admin and change a value or disable any other periodic task. As reported in in another issue the schedule doesn't change even though it is committed to the db.

If you then stop and restart the services and it will no longer schedule anything. To rectify the situation I found I can delete all periodic tasks and restart both the celery worker and camera and viola everything is back to normal.

FYI:

celery -A celery_app report

software -> celery:4.0.2 (latentcall) kombu:4.0.2 py:2.7.10
            billiard:3.5.0.2 py-amqp:2.1.4
platform -> system:Darwin arch:64bit imp:CPython
loader   -> celery.loaders.app.AppLoader
settings -> transport:amqp results:django-db

CELERY_BROKER_PORT: u'5672'
CELERY_RESULT_SERIALIZER: u'json'
CELERY_BROKER_URL: u'amqp://icmadmin:********@localhost:5672/icmanage'
CELERY_TASK_TIME_LIMIT: 28800
CELERY_TASK_TRACK_STARTED: True
CELERY_WORKER_CONCURRENCY: 4
CELERY_BROKER_HOST: u'localhost'
CELERY_BROKER_USER: u'icmadmin'
CELERY_RESULT_BACKEND: u'django-db'
CELERY_TASK_SERIALIZER: u'json'
CELERY_BROKER_PASSWORD: u'********'
CELERY_ACCEPT_CONTENT: [u'json']
CELERY_BEAT_SCHEDULER: u'django_celery_beat.schedulers:DatabaseScheduler'
CELERY_SEND_EVENTS: True
CELERY_SEND_TASK_ERROR_EMAILS: True

from django-celery-beat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.