Issue 1:
from celery import Celeryapp = Celery()app.conf.update ( enable_utc=True, timezone='UTC')app.conf.beat_schedule = { 'test': { 'task': 'test', 'schedule': 5, }}@app.task(bind=True, name='test')def test(self): if self.app.finalized: raise ValueError("APP finalized.")

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: v4.3.0

celery -A example worker -B -E --loglevel=info Output:

-------------- celery@user v4.3.0 (rhubarb)

---- **** -----

--- * *** * -- Linux-5.2.11-100.fc29.x86_64-x86_64-with-fedora-29-Twenty_Nine 2019-09-19 16:57:03

-- * - **** ---

** ---------- [config]

** ---------- .> app: main:0x7f88ce002978

** ---------- .> transport: amqp://guest:**@localhost:5672//

** ---------- .> results: disabled://

*** --- * --- .> concurrency: 4 (prefork)

-- ******* ---- .> task events: ON

--- ***** -----

-------------- [queues]

.> celery exchange=celery(direct) key=celery

[tasks]

. test

[2019-09-19 16:57:03,962: INFO/Beat] beat: Starting...

[2019-09-19 16:57:03,993: INFO/Beat] Scheduler: Sending due task test (test)

[2019-09-19 16:57:04,083: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//

[2019-09-19 16:57:04,096: INFO/MainProcess] mingle: searching for neighbors

[2019-09-19 16:57:05,149: INFO/MainProcess] mingle: all alone

[2019-09-19 16:57:05,186: INFO/MainProcess] celery@user ready.

[2019-09-19 16:57:05,186: INFO/MainProcess] Received task: test[73cb77be-6111-4a61-a882-32b4ccd7890e]

[2019-09-19 16:57:05,290: ERROR/ForkPoolWorker-5] Task test[73cb77be-6111-4a61-a882-32b4ccd7890e] raised unexpected: ValueError('APP finalized.',)

Traceback (most recent call last):

File "/misc-VAl3-rUJ/lib/python3.6/site-packages/celery/app/trace.py", line 385, in trace_task

R = retval = fun(*args, **kwargs)

File "/misc-VAl3-rUJ/lib/python3.6/site-packages/celery/app/trace.py", line 648, in protected_call

return self.run(*args, **kwargs)

File "/home/.../example.py", line 19, in test

raise ValueError("APP finalized.")

ValueError: APP finalized.

Python Packages

pip freeze Output:

-i https://pypi.org/simple
amqp==2.5.1
billiard==3.6.1.0
celery==4.3.0
importlib-metadata==0.23
kombu==4.6.4
more-itertools==7.2.0
pytz==2019.2
vine==1.3.0
zipp==0.6.0

Minimally Reproducible Test Case

from celery import Celery

app = Celery()
app.conf.update (
enable_utc=True,
timezone='UTC')

app.conf.beat_schedule = {
'test': {
'task': 'test',
'schedule': 5,
}
}

@app.task(bind=True, name='test')
def test(self):
if self.app.finalized:
raise ValueError("APP finalized.")

Expected Behavior

I expected that the app.finalized be false, once that the app itself is running this task.

Actual Behavior

Flag is True

Issue 2:
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

#4341

Possible Duplicates

#4341

Environment & Settings

Celery version:

celery report Output:

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

Expected Behavior

Actual Behavior

We are using celery==4.3.0 and seeing the exact same closed issue at #4341

Essentially, the exponential backoff retry is defaulting to 180s: Retry in 180s.

Has this feature actually been implemented in Celery?