Comments (4)
The exception that is raised is not pickleable:
>>> from requests.packages.urllib3.exceptions import MaxRetryError
>>> x = MaxRetryError(None, "foo")
>>> import pickle
>>> pickle.loads(pickle.dumps(x))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1382, in loads
return Unpickler(file).load()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 858, in load
dispatch[key](self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1133, in load_reduce
value = func(*args)
TypeError: __init__() takes exactly 3 arguments (2 given)
Celery have some elaborate mechanisms to deal with these non-standard exceptions though,
and it works fine for me:
@task
def unpick():
from requests.packages.urllib3.exceptions import MaxRetryError
raise MaxRetryError(None, "http://foo")
Does that not work for you? If it does, then at what point does it raise this exception?
from billiard.
I can confirm by upgrading to django-celery 3.0.11
and billard 2.7.3.19
that comes with it; stops the crashing of celery when a Exception that cannot be pickled is returned.
from billiard.
Closing
from billiard.
I'm still having the exact same problem with celery 3.0.18 and billard 2.7.3.19:
[2013-04-15 20:23:59,174: ERROR/MainProcess] Unrecoverable error: TypeError('__init__() takes exactly 3 arguments (2 given)', <class 'requests.packages.urllib3.exceptions.MaxRetryError'>, ("HTTPConnectionPool(hos
t='xxx', port=80): Max retries exceeded with url: xxx,))
Traceback (most recent call last):
File "/home/deployer/titans-mobile-learning/.venv/lib/python2.6/site-packages/celery/worker/__init__.py", line 347, in start
component.start()
File "/home/deployer/titans-mobile-learning/.venv/lib/python2.6/site-packages/celery/worker/consumer.py", line 390, in start
self.consume_messages()
File "/home/deployer/titans-mobile-learning/.venv/lib/python2.6/site-packages/celery/worker/consumer.py", line 474, in consume_messages
readers[fileno](fileno, event)
File "/home/deployer/titans-mobile-learning/.venv/lib/python2.6/site-packages/billiard/pool.py", line 672, in handle_event
self._it.next()
File "/home/deployer/titans-mobile-learning/.venv/lib/python2.6/site-packages/billiard/pool.py", line 645, in _process_result
ready, task = poll(timeout)
File "/home/deployer/titans-mobile-learning/.venv/lib/python2.6/site-packages/billiard/pool.py", line 1062, in _poll_result
return True, self._quick_get()
TypeError: ('__init__() takes exactly 3 arguments (2 given)', <class 'requests.packages.urllib3.exceptions.MaxRetryError'>, ("HTTPConnectionPool(host='x', port=80): Max retries exceeded with url: x",))
from billiard.
Related Issues (20)
- Run integration test of GA CI
- 4.0.0: sphinx warnings (mainly `reference target not found`) HOT 2
- dynamic pool size with gnumake jobclient / jobserver
- ExceptionWithTraceback object has no attribute __cause__ HOT 4
- NameError on Pool.shrink() HOT 5
- Hard Timeout Triggers AttributeError on Windows HOT 1
- billiard==4.0.2 and celery==5.2.7 HOT 1
- Python 3.11: '_Code' object has no attribute 'co_positions' HOT 20
- Worker exited prematurely: signal 9 (SIGKILL) Job: 10.
- TypeError when using `soft_timeout` or `timeout` on `Pool`
- Add support for ExceptionGroups - PEP-0654 HOT 2
- Trouble with calling process
- Task randomly get stuck (between parent and child)
- Replacing `mktemp` usage in multiple files HOT 2
- Long hangs when `os.sysconf('SC_OPEN_MAX')` is large
- Process doesn't run target function after call to celery's app.control().inspect() HOT 1
- Billiard hangs when exception is thrown in a finally block
- Python 3.13: billiard.util.get_logger() is broken HOT 2
- Use `dill.dumps` and `dill.loads` serialization instead of `pickle`
- WorkerLostError Handling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from billiard.