Issue 1:
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:5.2.0rc1 (dawn-chorus) kombu:5.2.0rc1 py:3.7.12
billiard:3.6.4.0 py-amqp:5.0.6
platform -> system:Linux arch:64bit, ELF
kernel version:5.10.47-linuxkit imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:pyamqp results:disabled

broker_url: 'amqp://guest:********@broker:5672//'
deprecated_settings: None

Steps to Reproduce

Required Dependencies

Minimal Python Version: 3.7

Minimal Celery Version: 5.1.2

Minimal Kombu Version: N/A

Minimal Broker Version: N/A

Minimal Result Backend Version: N/A

Minimal OS and/or Kernel Version: N/A

Minimal Broker Client Version: N/A

Minimal Result Backend Client Version: N/A

Python Packages

pip freeze Output:

amqp==5.0.6
billiard==3.6.4.0
cached-property==1.5.2
celery @ git+https://github.com/celery/celery@49452916f94d5ec60af246cea600855e6d976b48
click==8.0.1
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
importlib-metadata==4.8.1
kombu==5.2.0rc1
prompt-toolkit==3.0.20
pytz==2021.3
six==1.16.0
typing-extensions==3.10.0.2
vine==5.0.0
wcwidth==0.2.5
zipp==3.6.0

Other Dependencies

N/A

Minimally Reproducible Test Case

from celery import Celery

app = Celery("tasks", broker="pyamqp://guest@broker//")

class BrokenException(Exception):
"""
This Exception can't be unpickled by default
"""
def __init__(self, msg, other_arg):
super().__init__(msg)
self.other_arg = other_arg

@app.task(bind=True)
def unsafe_exception(self):
self.retry(exc=BrokenException("msg", "other_arg"))

def main():
unsafe_exception.delay()

if __name__ == "__main__":
main()

Then run with python tasks.py

Repo here:

https://github.com/amcgavin/celery-issue/

Expected Behavior

Exception occurs in the worker handler, but handled gracefully.

note: this was the behaviour in celery==5.0.2

Actual Behavior

worker process crashes, with exit code 0.

Note that raising the exception directly doesn't crash (see the repo for detailed example).

celery_1 | [2021-10-08 08:34:10,200: INFO/MainProcess] Task tasks.unsafe_exception[38b08c18-451b-4645-a4ac-ada2e6b43e5e] received
celery_1 | [2021-10-08 08:34:10,201: CRITICAL/MainProcess] Unrecoverable error: TypeError("__init__() missing 1 required positional argument: 'other_arg'")
celery_1 | Traceback (most recent call last):
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/worker/worker.py", line 203, in start
celery_1 | self.blueprint.start(self)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 116, in start
celery_1 | step.start(parent)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 365, in start
celery_1 | return self.obj.start()
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 326, in start
celery_1 | blueprint.start(self)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 116, in start
celery_1 | step.start(parent)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 618, in start
celery_1 | c.loop(*c.loop_args())
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/worker/loops.py", line 81, in asynloop
celery_1 | next(loop)
celery_1 | File "/usr/local/lib/python3.7/site-packages/kombu/asynchronous/hub.py", line 361, in create_loop
celery_1 | cb(*cbargs)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py", line 325, in on_result_readable
celery_1 | next(it)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py", line 306, in _recv_message
celery_1 | message = load(bufv)
celery_1 | TypeError: __init__() missing 1 required positional argument: 'other_arg'
celery_1 | [2021-10-08 08:34:41,378: ERROR/MainProcess] Task handler raised error: WorkerLostError('Worker exited prematurely: exitcode 0 Job: 2.')
celery_1 | Traceback (most recent call last):
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/worker/worker.py", line 203, in start
celery_1 | self.blueprint.start(self)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 116, in start
celery_1 | step.start(parent)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 365, in start
celery_1 | return self.obj.start()
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 326, in start
celery_1 | blueprint.start(self)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/bootsteps.py", line 116, in start
celery_1 | step.start(parent)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 618, in start
celery_1 | c.loop(*c.loop_args())
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/worker/loops.py", line 81, in asynloop
celery_1 | next(loop)
celery_1 | File "/usr/local/lib/python3.7/site-packages/kombu/asynchronous/hub.py", line 361, in create_loop
celery_1 | cb(*cbargs)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py", line 325, in on_result_readable
celery_1 | next(it)
celery_1 | File "/usr/local/lib/python3.7/site-packages/celery/concurrency/asynpool.py", line 306, in _recv_message
celery_1 | message = load(bufv)
celery_1 | TypeError: __init__() missing 1 required positional argument: 'other_arg'
celery_1 |
celery_1 | During handling of the above exception, another exception occurred:
celery_1 |
celery_1 | Traceback (most recent call last):
celery_1 | File "/usr/local/lib/python3.7/site-packages/billiard/pool.py", line 1267, in mark_as_worker_lost
celery_1 | human_status(exitcode), job._job),
celery_1 | billiard.exceptions.WorkerLostError: Worker exited prematurely: exitcode 0 Job: 2.
celery-example_celery_1 exited with code 0

Issue 2:
Checklist

I have checked the issues list

for similar or identical feature requests.

I have checked the pull requests list

for existing proposed implementations of this feature.

I have checked the commit log

to find out if the if the same feature was already implemented 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).

Request

Hi there! I would love to have the celery logo as an SVG please. Can you share it in the repo please?