Skip to content

Instantly share code, notes, and snippets.

@dylanahsmith
Last active January 15, 2019 12:46
Show Gist options
  • Save dylanahsmith/10047924 to your computer and use it in GitHub Desktop.
Save dylanahsmith/10047924 to your computer and use it in GitHub Desktop.
mysql2 EINTR on connect error reproduction
#!/usr/bin/env ruby
require 'mysql2'
trap("USR2") {}
pid = fork do
loop do
client = Mysql2::Client.new
client.close
end
end
until Process.waitpid(pid, Process::WNOHANG)
Process.kill("USR2", pid)
sleep 0.01
end
puts $?.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment