Skip to content

Worker restarted and visibility timeout not exceeded - task will not be re-executed #4976

@galCohen88

Description

@galCohen88

Checklist

  • I have included the output of celery -A proj report in the issue.
    (if you are not able to do this, then at least specify the Celery
    version affected).
  • I have verified that the issue exists against the master branch of Celery.

Using 4.2.1

[2018-08-12 08:39:27,855: INFO/MainProcess] Connected to redis://***:6379
[2018-08-12 08:39:27,865: INFO/MainProcess] mingle: searching for neighbors
[2018-08-12 08:39:28,934: INFO/MainProcess] mingle: all alone
[2018-08-12 08:39:28,997: INFO/MainProcess] e547ccc ready.

==> app-celery-stdout---supervisor-er5uXH.log <==

Steps to reproduce

Using redis transport

  1. Create new job with acks_late flag as True
  2. Use gevent and patch it using monkey.patch_all()
  3. Execute the task
  4. While task is executed (and visibility_timeout is far from expiry) kill the worker
  5. Task is not re-executed after new worker is initiated

Expected behavior

Task should be executed after new worker initiated

Actual behaviour

Task is not re-executed

The problem is that querying unacked_index zset with score timeframe based on visibility_timeout only once (polling loop is disabled when using gevent). Meaning if the visibility_timeout is not expired the task will not be re-executed ever

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions