<h1 dir="auto">Checklist</h1>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+label%3A%22Category%3A+Documentation%22+">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues in this issue<br>
(If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>

<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h1 dir="auto">Description</h1>

<p dir="auto">Prior to Celery 4.4.0, the celery.app.control.Inspect.scheduled() API used to return "args" and "kwargs" as strings which could be parsed using ast.literal_eval. Now, they seem to be a list and dict respectively:</p>
<p dir="auto">{'id': 'd82058c7-12b0-4914-8381-2fef9ad874a9', 'name': '...', 'args': ['time', 'sleep', 5], 'kwargs': {}, 'type': '...', }</p>
<h1 dir="auto">Suggestions</h1>

<p dir="auto">I assume this is a deliberate design change; it would have been helpful to add this breaking change to the release notes!</p>
<h1 dir="auto">Checklist</h1>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown &amp; rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>

<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="196870340" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/3712" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/3712/hovercard" href="https://github.com/celery/celery/issues/3712">#3712</a></li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment &amp; Settings</h2>

<p dir="auto"><strong>Celery version</strong>: 4.2.1</p>

<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><p dir="auto">celery -A svc.tasks.tasks worker -Q try1 -l info --concurrency=1 -E --time-limit=10<br>
celery_1  | Please specify a different user using the --uid option.<br>
celery_1  |<br>
celery_1  | User information: uid=0 euid=0 gid=0 egid=0<br>
celery_1  |<br>
celery_1  | uid=uid, euid=euid, gid=gid, egid=egid,<br>
celery_1  | [2019-11-21 14:22:20,830: INFO/MainProcess]<br>
celery_1  |<br>
celery_1  | [2019-11-21 14:22:21,269: INFO/MainProcess] Connected to sqs://AKIASKQ2RR3ONPGUV6GP:**@sqs.us-east-1.amazonaws.com/160043208412/try1<br>
celery_1  | [2019-11-21 14:22:21,276: INFO/MainProcess]<br>
celery_1  | [2019-11-21 14:22:21,797: INFO/MainProcess] <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/celery/celery/commit/e9d5e94d2270/hovercard" href="https://github.com/celery/celery/commit/e9d5e94d2270"><tt>e9d5e94d2270</tt></a> ready.</p>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>

<ul dir="auto">
<li><strong>Minimal Python Version</strong>: 2.6</li>
<li><strong>Minimal Celery Version</strong>: 4.2.1</li>
<li><strong>Minimal Kombu Version</strong>: 4.6.6</li>
<li><strong>Minimal Broker Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>

<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="amqp==2.5.2
billiard==3.6.1.0
boto3==1.10.23
botocore==1.13.23
celery==4.4.0rc4
Click==7.0
docutils==0.15.2
Flask==1.1.1
importlib-metadata==0.23
itsdangerous==1.1.0
Jinja2==2.10.3
jmespath==0.9.4
kombu===4.6.6
MarkupSafe==1.1.1
more-itertools==7.2.0
pycurl==7.43.0.3
python-dateutil==2.8.0
pytz==2019.3
redis==2.10.6
s3transfer==0.2.1
six==1.13.0
urllib3==1.25.7
vine==1.3.0
Werkzeug==0.16.0
zipp==0.6.0"><pre class="notranslate"><code class="notranslate">amqp==2.5.2
billiard==3.6.1.0
boto3==1.10.23
botocore==1.13.23
celery==4.4.0rc4
Click==7.0
docutils==0.15.2
Flask==1.1.1
importlib-metadata==0.23
itsdangerous==1.1.0
Jinja2==2.10.3
jmespath==0.9.4
kombu===4.6.6
MarkupSafe==1.1.1
more-itertools==7.2.0
pycurl==7.43.0.3
python-dateutil==2.8.0
pytz==2019.3
redis==2.10.6
s3transfer==0.2.1
six==1.13.0
urllib3==1.25.7
vine==1.3.0
Werkzeug==0.16.0
zipp==0.6.0
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>

<details>
<p dir="auto">
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>

<details>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from celery import Celery
app.conf.worker_prefetch_multiplier = 1

@app.task(base=BaseAsyncJobTask, acks_late=True, acks_on_failure_or_timeout=False)
def dead_letter_q_task():
    return 1/0

dead_letter_q_task.delay()
dead_letter_q_task.delay()
dead_letter_q_task.delay()"><pre class="notranslate"><code class="notranslate">from celery import Celery
app.conf.worker_prefetch_multiplier = 1

@app.task(base=BaseAsyncJobTask, acks_late=True, acks_on_failure_or_timeout=False)
def dead_letter_q_task():
    return 1/0

dead_letter_q_task.delay()
dead_letter_q_task.delay()
dead_letter_q_task.delay()
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">I expect all the tasks to be executed, although the first task failed</p>
<h1 dir="auto">Actual Behavior</h1>

<p dir="auto">The first task was executed, but the rest weren't.</p>
<p dir="auto">The problem originates from the prefetch multiplier feature, with acks_late=True and acks_on_failure_or_timeout=False flags.</p>
<p dir="auto">The problem is that the prefetched task is remaining in the local queue although it was failed (because it will not be acked on failure). This causes the mechanism not fetching any more tasks, and workers are not executing anything.</p>
<p dir="auto">I.e the solution would be acking the message in the local queue, but not acking it in the remote queue.</p>
<p dir="auto">I would like to fix the issue myself, but I can't figure out how can I remove from <a href="https://github.com/celery/kombu/blob/master/kombu/transport/virtual/base.py#L191">https://github.com/celery/kombu/blob/master/kombu/transport/virtual/base.py#L191</a><br>
The failed task</p>