Rescue from SyntaxError when deserializing YAML #460

Merged
merged 3 commits into from Sep 24, 2014

Conversation

Projects
None yet
7 participants

wok commented Dec 14, 2012

If the YAML for the payload object is syntactically incorrect Psych will raise a SyntaxError which was not captured by Delayed::Backend::Base::payload_object.

The syntax error happend because the payload was truncated during serialisation to the database. Payload data was longer than DB column size.

When the SyntaxError was raised, delayed_job quit and no other jobs in the queue were processed.

nazgob commented Dec 14, 2012

+1, better than current state but I still don't see when you would like not to catch all exceptions.

afast commented Jan 7, 2013

I'm currently having a problem with this. Is there any workaround?

nazgob commented Jan 7, 2013

@afast You can use wok or mine forks with a fix.

afast commented Jan 7, 2013

Thanks @nazgob

+1, Would love to this this patch merged as well, using @wok patch already.

👍 My delayed_job workers have been dying because psych raises a Psych::SyntaxError when it encounters Chinese characters

@zmillman did this patch fix your issue? I'm experiencing the same with Chinese characters.

zmillman commented Dec 4, 2013

Yep. I've been catching syntax errors for 6 months now :)

albus522 merged commit d1f53b4 into collectiveidea:master Sep 24, 2014

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment