I have a celery task:
@celery.task(name='tasks.ht_run', default_retry_delay=30, max_retries=15, time_limit=1) def ht_run(str_command): try: f = os.popen(str_command) output = f.read() if output == '': raise Exception except Exception as exc: raise ht_run.retry(exc=exc) return output.split('\n')
And it's called like that: appserver.ht_run.delay (string)
While I expect it to try again when there is a timeout, instead, if it just fails. In the Celery window, I get the following error:
[2014-12-10 11:50:22,128: ERROR/MainProcess] Task tasks.ht_run[6a83793a-8bd6-47fc-bf74-0b673bf961f2] raised unexpected: TimeLimitExceeded(1,) Traceback (most recent call last): File "/Users/andy.terhune/cgenv/lib/python2.6/site-packages/billiard/pool.py", line 639, in on_hard_timeout raise TimeLimitExceeded(job._timeout) TimeLimitExceeded: TimeLimitExceeded(1,) [2014-12-10 11:50:22,128: ERROR/MainProcess] Hard time limit (1s) exceeded for tasks.ht_run[6a83793a-8bd6-47fc-bf74-0b673bf961f2] [2014-12-10 11:50:23,644: ERROR/MainProcess] Process 'Worker-28' pid:2081 exited with 'signal 9 (SIGKILL)'
How can I get this for a timeout and try again when this happens?
source share