New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long ETA tasks executed multiple times on Redis broker despite setting visibility_timeout #2599

Closed
vrastogi opened this Issue Apr 29, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@vrastogi

vrastogi commented Apr 29, 2015

I have the same issue as that in http://stackoverflow.com/q/12683546/567555

Like other commenters to that question, I can confirm that this bug is present. I am using celery 3.1.17, kombu 3.0.24, Redis server 2.8.4 with both the Redis server and the workers running on the same machine. My tasks have a countdown of 6 hours, so I set the visibility_timeout to 43200 (12 hours). Printing the visibility_timeout just before it is used in restore_visible of kombu/transport/redis.py indicates that it is set correctly. But I can still see the same tasks executed multiple times.

Here is my celery configuration, if it matters.

app.config_from_object({
    'BROKER_URL': 'redis://localhost:6379',
    'CELERY_RESULT_BACKEND': 'redis://localhost:6379',
    'CELERYD_POOL_RESTARTS': True,  # Required for /worker/pool/restart API
    'CELERYD_CONCURRENCY': 100,
    # need visibility timeout greater than 6 hours
    'BROKER_TRANSPORT_OPTIONS': {'visibility_timeout': 43200}, # 12 hours
    'CELERYD_TASK_TIME_LIMIT': 1200,
    'CELERY_ACCEPT_CONTENT': ['json'],
    'CELERY_TASK_SERIALIZER': 'json',
    'CELERY_RESULT_SERIALIZER': 'json'
})

Will be happy to provide further information.

@vrastogi vrastogi changed the title from Long ETA tasks executed multiple times onRedis broker despite setting visibility_timeout to Long ETA tasks executed multiple times on Redis broker despite setting visibility_timeout Apr 29, 2015

@fatihsucu

This comment has been minimized.

Show comment
Hide comment
@fatihsucu

fatihsucu Apr 29, 2015

Contributor

Yes this bug still exist. I couldn't override that visibility timeout settings too. I use rabbitmq broker instead of redis broker for solve this problem. If you don't have wait for update i suggest that.

Contributor

fatihsucu commented Apr 29, 2015

Yes this bug still exist. I couldn't override that visibility timeout settings too. I use rabbitmq broker instead of redis broker for solve this problem. If you don't have wait for update i suggest that.

@vrastogi

This comment has been minimized.

Show comment
Hide comment
@vrastogi

vrastogi Apr 29, 2015

Thanks for another confirmation. I will consider your work-around.

vrastogi commented Apr 29, 2015

Thanks for another confirmation. I will consider your work-around.

@ask

This comment has been minimized.

Show comment
Hide comment
@ask

ask May 6, 2015

Member

Just confirmed here, and the visibility timeout is indeed set by BROKER_TRANSPORT_OPTIONS = {'visibility_timeout': 30}.

Are you sure you do not have some other consumer running using a different visibility timeout?
E.g. a flower instance running with a default visibility timeout.

Any message consumer using the kombu redis transport will happily restore visible messages
for you, so you have to make sure all of them are using the same configuration.

Member

ask commented May 6, 2015

Just confirmed here, and the visibility timeout is indeed set by BROKER_TRANSPORT_OPTIONS = {'visibility_timeout': 30}.

Are you sure you do not have some other consumer running using a different visibility timeout?
E.g. a flower instance running with a default visibility timeout.

Any message consumer using the kombu redis transport will happily restore visible messages
for you, so you have to make sure all of them are using the same configuration.

@vrastogi

This comment has been minimized.

Show comment
Hide comment
@vrastogi

vrastogi May 14, 2015

Sorry for the late reply. I have not checked anything else, but yes I am running a flower instance. That seems to explain this problem. Is there a way to set a visibility_timeout of flower?

vrastogi commented May 14, 2015

Sorry for the late reply. I have not checked anything else, but yes I am running a flower instance. That seems to explain this problem. Is there a way to set a visibility_timeout of flower?

@ask

This comment has been minimized.

Show comment
Hide comment
@ask

ask May 14, 2015

Member

Just point it to an app: celery -A proj flower

Member

ask commented May 14, 2015

Just point it to an app: celery -A proj flower

@vrastogi

This comment has been minimized.

Show comment
Hide comment
@vrastogi

vrastogi May 14, 2015

That is what I have been doing but seems I never restarted flower after changing the visibility_timeout. Closing this issue now.

vrastogi commented May 14, 2015

That is what I have been doing but seems I never restarted flower after changing the visibility_timeout. Closing this issue now.

@vrastogi vrastogi closed this May 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment