Last active
January 15, 2019 12:46
-
-
Save dylanahsmith/10047924 to your computer and use it in GitHub Desktop.
mysql2 EINTR on connect error reproduction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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