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'
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: