Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

Discard task on exception in decode step #68

Open
acoover opened this issue Jan 8, 2015 · 1 comment
Open

Discard task on exception in decode step #68

acoover opened this issue Jan 8, 2015 · 1 comment

Comments

@acoover
Copy link

acoover commented Jan 8, 2015

In worker_handler, we should discard jobs that raise exceptions when attempting to decode

https://github.com/Yelp/python-gearman/blob/master/gearman/worker_handler.py#L134

@svisser
Copy link

svisser commented Apr 24, 2015

Related to this: a subclass of gearman.DataEncoder should be able to indicate that it couldn't decode the message. I'm now using a hack in decode to return something (ideally I should be able to raise an exception or otherwise indicate decoding could not be done):

    @classmethod
    def decode(cls, decodable_string):
        try:
            return json.loads(decodable_string)
        except (TypeError, ValueError):
            return InvalidJobDictionary()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants