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

"NoMethodError: undefined method `bytesize' for nil:NilClass" in random circumstances on 4.2.3 #961

Closed
tylercrocker opened this issue Nov 18, 2020 · 5 comments

Comments

@tylercrocker
Copy link

[GEM_ROOT]/gems/redis-4.2.3/lib/redis/connection/ruby.rb:86:in `block in _write_to_socket'

I'm getting a no method error on nil when calling data.bytesize.

This appears to happen very randomly, but once it happens for a given call it continues to happen.

I noticed this because some recaching logic we use on our site where we periodically use a worker to recache about 6,000 pages or so. Roughly a dozen pages would get locked on this error. If the page was uncached and I manually tried to cache it it would continue to do this until the following day where I'd get a different set of pages that erred out.

This does not happen when I roll back to version 4.2.2

I don't have a way to readily replicate this outside of our system and I was not able to replicate it locally, but any insight would be appreciated.

For now I'm just rolling us back to 4.2.2

@byroot
Copy link
Collaborator

byroot commented Nov 18, 2020

Thanks for the report, this is likely a bug in #960 or #926 I'll try to figure it out.

Any additional information allowing to repro would be welcome. Also please submit a longer backtrace. you don't have to include parts that come from your app, but the other frames from redis-rb would help.

cc @ioquatix

@byroot
Copy link
Collaborator

byroot commented Nov 18, 2020

Oh and you ruby version too please.

@byroot
Copy link
Collaborator

byroot commented Nov 20, 2020

This should be fixed in 4.2.3

@cdmo
Copy link

cdmo commented Jan 26, 2021

@byroot did you mean to say this is fixed in 4.2.5? We saw this in 4.2.3 as well and upgrading to 4.2.5 fixed it.

@byroot
Copy link
Collaborator

byroot commented Jan 26, 2021

Indeed. Sorry.

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