-
Notifications
You must be signed in to change notification settings - Fork 93
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
Controlling lock behaviour on task failure #110
Comments
Hmm, this is starting to seriously limit my ability to manually retry certain tasks. Suppose scheduled Is there a solution to this that I'm not aware of? perhaps manually deleting the key in redis..? that seems a bit too low-level. |
@SHxKM Sorry for the slow reply. Currently, if you invoke a task locally, i.e call This could explain why you are not seeing Just to double-check, are you calling the task function directly or with |
@cameronmaske Please don't apologize. This library has spared me a logistical hellstew, so thank you!
Yes. Basically
This makes sense. Any way to mitigate the above? |
Ok. If the task is interrupted due to a hard worker restart, I'm not sure how celery handles it. We currently don't test against that scenario, so maybe that prevents the lock from clearing. But, that doesn't seem to line up with the scenario you have described. Are you using the package |
Yes, this is happening in a Django app.
Python 3.6.8
I don't have from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
from raven.contrib.celery import register_logger_signal, register_signal
from raven.contrib.django.raven_compat.models import client
app = Celery("my_app")
app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks()
# this code may be problematic?
register_logger_signal(client)
register_logger_signal(client)
register_signal(client)
register_signal(client, ignore_expected=True) If I'm not mistaken I added those |
Sentry's @SHxKM I'm having trouble re-creating this issue, in order to figure out the cause. Running celery_once's tests against your version of Python + Celery still pass. Any chance you could put together a minimal example that reproduces this issue?i |
Hi, thanks for the superb library.
I have a long running task, it takes a single argument
user_id
.I did a system restart while this task was running. This made this task fail. I use
celery-once
for this task because it's scheduled to run every X minutes,celery-once
is working superbly in preventingtask_a()
from running at the same time for the sameuser_id
.But I can also invoke
task_a()
manually. When I tried to do so with theuser_id
when the task failed, I wouldn't get any kind of warning abouttask_a()
beingAlreadyQueued
or anything - the task just wasn't sent to my workers. It's like celery stopped communicating for thistask_a()
when invoked with that specificuser_id
.After one hour had passed, which is my global lock timeout for
celery-once
, I could invoke the task manually.I find this a bit odd. I realize that the task wasn't invoked at all because there was a lock acquired on it, but shouldn't I have seen an error, warning, or any other indication that this task is being intentionally ignored?
The text was updated successfully, but these errors were encountered: