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

Occasional Errno::EBADF via Sidekiq. Thread-safety issues? #101

Open
henrik opened this issue May 11, 2023 · 0 comments
Open

Occasional Errno::EBADF via Sidekiq. Thread-safety issues? #101

henrik opened this issue May 11, 2023 · 0 comments

Comments

@henrik
Copy link

henrik commented May 11, 2023

We've seen an Errno::EBADF: Bad file descriptor error from this lib twice in the past 3 weeks.

It runs in Sidekiq jobs (meaning it's multi-threaded). My suspicion is that it's a thread-safety issue where if two requests overlap, they might both try to close the same connection/socket causing this error.

I'm not close to expert at threading or networking so this is a complete guess.

Backtrace:

/opt/ruby/lib/ruby/3.2.0/openssl/ssl.rb:387 :in 'close'
/opt/ruby/lib/ruby/3.2.0/openssl/ssl.rb:387 :in 'sysclose'
/opt/ruby/lib/ruby/3.2.0/openssl/buffering.rb:485 in 'close'
/opt/ruby/lib/ruby/3.2.0/net/http.rb:1357 in 'rescue in connect'
/opt/ruby/lib/ruby/3.2.0/net/http.rb:1253 in 'connect'
/opt/ruby/lib/ruby/3.2.0/net/http.rb:1248 in 'do_start'
/opt/ruby/lib/ruby/3.2.0/net/http.rb:1237 :in 'start'
[GEM_ROOT]/gems/customerio-5.0.0/lib/customerio/base_client.rb:62:in 'execute'
[GEM_ROOT]/gems/customerio-5.0.0/lib/customerio/base_client.rb:28:in 'request'
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

1 participant