Issue 1:
Checklist

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

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.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

I have tried reproducing the issue on more than one message broker and/or

result backend.

I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version:

celery report Output:

Steps to Reproduce

Required Dependencies

Minimal Python Version: 3.6

Minimal Celery Version: 4.3

Minimal Kombu Version: 4.5.0

Minimal Broker Version: rabbitmq 3.7.13

Minimal Result Backend Version: redis 3.2.10

Minimal OS and/or Kernel Version: python 3.6 docker image

Minimal Broker Client Version: librabbitmq 2.0.0

Minimal Result Backend Client Version: redis 3.2.1

Python Packages

pip freeze Output:

Other Dependencies

N/A

Minimally Reproducible Test Case

Initially the application is using the below version of python libraries celery, librabbitmq and redis.

celery==4.2.1

librabbitmq==2.0.0

redis==2.10.6

celery.get(interval=0.001) # response time from redis avg below 10ms

After re-deployment the 3 dependencies above were updated to their latest version and eventually the celery.get(interval=0.001) is not working and it's defaulting to 500ms

celery==4.3.0

librabbitmq==2.0.0

redis==3.2.1

celery.get(interval=0.001) # response time from redis avg 500ms

Expected Behavior

Setting interval= 0.001 should decrease the number of waiting time to extract results from redis backend

Actual Behavior

The waiting time always defaults to 500ms even if interval is changes to a lower number

Issue 2:
Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussion group first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

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.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

I have tried reproducing the issue on more than one message broker and/or

result backend.

I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version:

celery report Output:

software -> celery:4.4.2 (cliffs) kombu:4.6.8 py:3.6.10
billiard:3.6.3.0 redis:3.4.1
platform -> system:Darwin arch:64bit
kernel version:19.4.0 imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:redis results:redis://localhost:6379/1

broker_url: 'redis://localhost:6379/1'
result_backend: 'redis://localhost:6379/1'

Steps to Reproduce

Required Dependencies

Minimal Python Version: N/A or Unknown

Minimal Celery Version: N/A or Unknown

Minimal Kombu Version: N/A or Unknown

Minimal Broker Version: N/A or Unknown

Minimal Result Backend Version: N/A or Unknown

Minimal OS and/or Kernel Version: N/A or Unknown

Minimal Broker Client Version: N/A or Unknown

Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output:

Other Dependencies

N/A

Minimally Reproducible Test Case

retry does not handle argsrepr and kwargsrepr, so sensitive datas are not hidden.

This occurs when task retry after a failure (*repr variables seems not be part of the retry message). Exception MaxRetriesExceededError also disclose args and kwargs insteed of argsrepr and kwargsrepr, even if max_retries=0 (when no retry occurs)

See following code :

from celery import Celery
from tasks import demo

app = Celery('tasks', broker='redis://localhost:6379/1', backend='redis://localhost:6379/1')

r = demo.apply_async(("user", "password"), argsrepr="user:****", kwargs={"password":"secretvalue"}, kwargsrepr="password:****")

from celery import Celery

app = Celery('tasks', broker='redis://localhost:6379/1', backend='redis://localhost:6379/1')

@app.task(bind=True, default_retry_delay=1)
def demo(self, *args, **kwargs):
print("Enter task")
print(self.request.args)
print(self.request.argsrepr)
print(self.request.kwargs)
print(self.request.kwargsrepr)
raise self.retry(max_retries=1)

Expected Behavior

All retries context should contain argsrepr and kwargsrepr values. Exception should report repr values also

[2020-05-12 23:10:18,349: WARNING/ForkPoolWorker-2] Enter task
[2020-05-12 23:10:18,352: WARNING/ForkPoolWorker-2] ['user', 'password']
[2020-05-12 23:10:18,353: WARNING/ForkPoolWorker-2] user:****
[2020-05-12 23:10:18,354: WARNING/ForkPoolWorker-2] {'password': 'secretvalue'}
[2020-05-12 23:10:18,355: WARNING/ForkPoolWorker-2] password:****
[2020-05-12 23:10:19,704: WARNING/ForkPoolWorker-2] Enter task
[2020-05-12 23:10:19,705: WARNING/ForkPoolWorker-2] ['user', 'password']
[2020-05-12 23:10:19,706: WARNING/ForkPoolWorker-2] user:****
[2020-05-12 23:10:19,710: WARNING/ForkPoolWorker-2] {'password': 'secretvalue'}
[2020-05-12 23:10:19,712: WARNING/ForkPoolWorker-2] password:****
[2020-05-12 23:10:19,721: ERROR/ForkPoolWorker-2] Task tasks.demo[97f47a98-f12a-4745-864e-deb99b9d5ab5] raised unexpected: MaxRetriesExceededError("Can't retry tasks.demo[97f47a98-f12a-4745-864e-deb99b9d5ab5] args:'user:****' kwargs:'password:****'
Traceback (most recent call last):
File "/Users/20010116/.pyenv/versions/3.6.10/envs/venv-test-flaskit-new/lib/python3.6/site-packages/celery/app/trace.py", line 385, in trace_task
R = retval = fun(*args, **kwargs)
File "/Users/20010116/.pyenv/versions/3.6.10/envs/venv-test-flaskit-new/lib/python3.6/site-packages/celery/app/trace.py", line 650, in __protected_call__
return self.run(*args, **kwargs)
File "/Users/20010116/Documents/Workspace/beapi--flaskit-snow-demo/tasks.py", line 12, in demo
raise self.retry(max_retries=1)
File "/Users/20010116/.pyenv/versions/3.6.10/envs/venv-test-flaskit-new/lib/python3.6/site-packages/celery/app/task.py", line 708, in retry
), task_args=S.args, task_kwargs=S.kwargs
celery.exceptions.MaxRetriesExceededError: Can't retry tasks.demo[97f47a98-f12a-4745-864e-deb99b9d5ab5] args:'user:****' kwargs:'password:****'

Actual Behavior

Only first task execution contain repr value. context of retry execution does not contain repr values any more. Exception dump full args and kwargs, so sensitive values are disclosed

[2020-05-12 23:10:18,349: WARNING/ForkPoolWorker-2] Enter task
[2020-05-12 23:10:18,352: WARNING/ForkPoolWorker-2] ['user', 'password']
[2020-05-12 23:10:18,353: WARNING/ForkPoolWorker-2] user:****
[2020-05-12 23:10:18,354: WARNING/ForkPoolWorker-2] {'password': 'secretvalue'}
[2020-05-12 23:10:18,355: WARNING/ForkPoolWorker-2] password:****
[2020-05-12 23:10:19,704: WARNING/ForkPoolWorker-2] Enter task
[2020-05-12 23:10:19,705: WARNING/ForkPoolWorker-2] ['user', 'password']
[2020-05-12 23:10:19,706: WARNING/ForkPoolWorker-2] ('user', 'password')
[2020-05-12 23:10:19,710: WARNING/ForkPoolWorker-2] {'password': 'secretvalue'}
[2020-05-12 23:10:19,712: WARNING/ForkPoolWorker-2] {'password': 'secretvalue'}
[2020-05-12 23:10:19,721: ERROR/ForkPoolWorker-2] Task tasks.demo[97f47a98-f12a-4745-864e-deb99b9d5ab5] raised unexpected: MaxRetriesExceededError("Can't retry tasks.demo[97f47a98-f12a-4745-864e-deb99b9d5ab5] args:('user', 'password') kwargs:{'password': 'secretvalue'}",)
Traceback (most recent call last):
File "/Users/20010116/.pyenv/versions/3.6.10/envs/venv-test-flaskit-new/lib/python3.6/site-packages/celery/app/trace.py", line 385, in trace_task
R = retval = fun(*args, **kwargs)
File "/Users/20010116/.pyenv/versions/3.6.10/envs/venv-test-flaskit-new/lib/python3.6/site-packages/celery/app/trace.py", line 650, in __protected_call__
return self.run(*args, **kwargs)
File "/Users/20010116/Documents/Workspace/beapi--flaskit-snow-demo/tasks.py", line 12, in demo
raise self.retry(max_retries=1)
File "/Users/20010116/.pyenv/versions/3.6.10/envs/venv-test-flaskit-new/lib/python3.6/site-packages/celery/app/task.py", line 708, in retry
), task_args=S.args, task_kwargs=S.kwargs
celery.exceptions.MaxRetriesExceededError: Can't retry tasks.demo[97f47a98-f12a-4745-864e-deb99b9d5ab5] args:('user', 'password') kwargs:{'password': 'secretvalue'}