PGconn.connect_start blocks the whole ruby process
When trying to connect to the some specific unresolved hostname(ex: foobar.us-east-1.redshift.amazonaws.com), PG::Connection.connect_start blocks the whole ruby process until timeout.
I'm using 'pg' gem to connect to an Amazon Redshift Cluster, and it happens when trying to connect to a terminated cluster.
You can reproduce it with the attachment file. The result is as following.
$ ruby test_ruby_db_drivers_block_in_connect2.rb pg ....................[pg: connecting to unreachable database (foobar.us-east-1.amazonaws.com)] test_ruby_db_drivers_block_in_connect3.rb:31:in `connect_start': could not translate host name "foobar.us-east-1.redshift.amazonaws.com" to address: nodename nor servname provided, or not known (PG::Error) from test_ruby_db_drivers_block_in_connect3.rb:31:in `<main>'