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

Marshal load fails silently #91

Closed
xaviervia opened this issue Mar 27, 2013 · 3 comments
Closed

Marshal load fails silently #91

xaviervia opened this issue Mar 27, 2013 · 3 comments

Comments

@xaviervia
Copy link

Hey! Really nice and useful gem here.

What I found is not actually a bug but I got stuck with this for a while, so here it comes.

I'm expanding a marshal serialization using Redis::List with the :marshal => true flag set, and I got a weird behavior: on some of my apps the objects were loaded correctly and in others I got just the raw string from the serialization.

After some debugging, I realized that Redis::List was rescuing the failed load attempt and falling back to the string serialization: while this behavior is reasonable, it can be quite confusing to debug.

It would be nice to have Redis::Object raising a custom Exception upon failure to load the marshal serialization.

Good luck

@nateware
Copy link
Owner

Appreciate the report. I looked into this quite a bit, and there's really no fix since redis-objects follows the recommended practice of rescue'ing marshal/dump failures with the raw data. Sorry this hit you.

@xaviervia
Copy link
Author

I didn't knew about the recommended practiced. I switched to JSON since. Thanks for looking into it.

@carloslopes
Copy link

@xaviervia one way that i found to avoid these instable loads is to define a simplistic #marshal_dump and #marshal_load in your object

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

No branches or pull requests

3 participants