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 empty? false:FalseClass #865

Open
ethanghunt opened this issue Feb 27, 2025 · 2 comments
Open

NoMethodError empty? false:FalseClass #865

ethanghunt opened this issue Feb 27, 2025 · 2 comments

Comments

@ethanghunt
Copy link

We have been working on API integrations and have often been running into this error when the targeted API is taking too much traffic.

undefined method `empty?' for false:FalseClass
.../ruby/gems/openssl-3.3.0/lib/openssl/buffering.rb:216:in `read_nonblock'

if @rbuffer.empty?

@rbuffer is false in this scenario, and unfortunately, boolean does not respond to .empty?

I noticed that this line of code has moved or been removed in the most recent commit of the repo, so some investigation may need to be done or it may already be fixed.

Thank you!

@rhenium
Copy link
Member

rhenium commented Feb 27, 2025

@rbuffer is only used in lib/openssl/buffering.rb, and is assigned only once in #initialize. So I don't see how it can become false.

Can you provide a reproducer?

@ethanghunt
Copy link
Author

ethanghunt commented Feb 27, 2025

I will do my best. It is an odd, probabilistic problem. Might take some time. I will let you know if I can't find the time.
In the meantime, we fixed this by adding empty? to FalseClass.

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

No branches or pull requests

2 participants