Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make exceptions picklable #835

Closed

Conversation

thehesiod
Copy link

No description provided.

@jamesls
Copy link
Member

jamesls commented Mar 7, 2016

Out of curiosity, how are you using pickled exceptions? I'd like to get a better understanding of how botocore exceptions are being used.

@jamesls jamesls added feature-request This issue requests a feature. response-requested Waiting on additional info and feedback. labels Mar 7, 2016
@thehesiod
Copy link
Author

yep! I've created a S3 process pool to be able to handle > 1000 requests/s. To do this I need to pickle the exceptions across the process boundary.

@t0m
Copy link

t0m commented Aug 31, 2016

Another use case for pickling exceptions is multiprocessing. I have a script that spawns a number of processes to handle SQS messages, and if a ClientError is raised I get the following error instead of the real one:

Exception in thread Thread-8:
Traceback (most recent call last):
  File "/Users/tterrace/.pyenv/versions/3.5.1/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/Users/tterrace/.pyenv/versions/3.5.1/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/tterrace/.pyenv/versions/3.5.1/lib/python3.5/multiprocessing/pool.py", line 429, in _handle_results
    task = get()
  File "/Users/tterrace/.pyenv/versions/3.5.1/lib/python3.5/multiprocessing/connection.py", line 251, in recv
    return ForkingPickler.loads(buf.getbuffer())
TypeError: __init__() missing 1 required positional argument: 'operation_name'

@thehesiod thehesiod closed this May 4, 2017
@thehesiod thehesiod deleted the pickleable-exceptions branch May 17, 2017 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requests a feature. response-requested Waiting on additional info and feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants