Skip to content
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

Adjust download blocker task retries to a sensible number #170

Open
nrejac opened this issue Apr 21, 2021 · 2 comments
Open

Adjust download blocker task retries to a sensible number #170

nrejac opened this issue Apr 21, 2021 · 2 comments

Comments

@nrejac
Copy link
Contributor

nrejac commented Apr 21, 2021

@app.task(bind=True, ignore_result=True, max_retries=None)
def blocker(self, rid, pollbase=1.25):
"""Wait for an AsyncResult to be ready, then return its result.

The download blocker task currently never stops retrying. There is a reference in the commit message that says these were terminating early. However, retrying endlessly can result in stuck tasks that never time out.

Adjust to a sensible number, preferably one that can be tweaked at run time.

@danstoner
Copy link
Contributor

danstoner commented Apr 22, 2021

The "download all of idigbio" task seems like it would need a very large number of retries. Or maybe I don't understand how this actually works.

I don't know what this comment really means, either:

This can be used to append tasks to a running one, block on the
    running and chain after this.

@danstoner
Copy link
Contributor

danstoner commented Apr 22, 2021

Reading some more of the context in our Slack...

If an exception is being "swallowed" and we keep retrying the same task, it seems like that is a bug that maybe ought to be fixed.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/celery/app/trace.py", line 382, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/celery/app/trace.py", line 641, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/idb-backend/idigbio_workers/tasks/download.py", line 94, in blocker
    countdown=pollbase ** self.request.retries)
  File "/usr/local/lib/python2.7/site-packages/celery/app/task.py", line 687, in retry
    raise ret
Retry: Retry in 108.420217249s

That's tricky, some exceptions we would want to retry (such as a service temporarily unavailable).

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

No branches or pull requests

2 participants