{"action":"created","issue":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/2568","repository_url":"https://api.github.com/repos/crystal-lang/crystal","labels_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2568/labels{/name}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2568/comments","events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2568/events","html_url":"https://github.com/crystal-lang/crystal/issues/2568","id":153588506,"number":2568,"title":"Domain resolution always fails on the second use","user":{"login":"lbguilherme","id":546954,"avatar_url":"https://avatars.githubusercontent.com/u/546954?v=3","gravatar_id":"","url":"https://api.github.com/users/lbguilherme","html_url":"https://github.com/lbguilherme","followers_url":"https://api.github.com/users/lbguilherme/followers","following_url":"https://api.github.com/users/lbguilherme/following{/other_user}","gists_url":"https://api.github.com/users/lbguilherme/gists{/gist_id}","starred_url":"https://api.github.com/users/lbguilherme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbguilherme/subscriptions","organizations_url":"https://api.github.com/users/lbguilherme/orgs","repos_url":"https://api.github.com/users/lbguilherme/repos","events_url":"https://api.github.com/users/lbguilherme/events{/privacy}","received_events_url":"https://api.github.com/users/lbguilherme/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/needs%20more%20info","name":"needs more info","color":"C53BEB"},{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/standard%20library","name":"standard library","color":"fad8c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-07T10:51:34Z","updated_at":"2016-05-27T15:04:16Z","closed_at":"2016-05-27T15:04:16Z","body":"The following Crystal code fails for me:\r\n\r\n```crystal\r\nrequire \"socket\"\r\n\r\np TCPSocket.new(\"google.com\", 80)\r\np TCPSocket.new(\"google.com\", 80)\r\n```\r\n\r\nIt always raises on the second connection:\r\n\r\n```\r\n#<TCPSocket:fd 12>\r\nError connecting to 'google.com:80': Network is unreachable (Errno)\r\n[4364583] *CallStack::unwind:Array(Pointer(Void)) +87\r\n[4364474] *CallStack#initialize<CallStack>:Array(Pointer(Void)) +10\r\n[4364426] *CallStack::new:CallStack +42\r\n[4372071] *Exception +39\r\n[4371992] *Errno#initialize<Errno, String>:CallStack +120\r\n[4371841] *Errno::new<String>:Errno +113\r\n[4414852] *TCPSocket +324\r\n[4411046] *TCPSocket#initialize<TCPSocket, String, Int32, Nil, Nil>:Nil +1206\r\n[4409816] *TCPSocket::new<String, Int32, Nil, Nil>:TCPSocket +184\r\n[4409627] *TCPSocket::new<String, Int32>:TCPSocket +27\r\n[4341583] ???\r\n[4349481] main +41\r\n[139866884900224] __libc_start_main +240\r\n[4339577] _start +41\r\n[0] ???\r\n```\r\n\r\nI'm having a hard time trying to understand why this happens. The exactly equal ruby code works as expected. And the error is reproduced every time I run: The first works, the second fails. The domain name might be relevant, with some others the error changes to `getaddrinfo: Non-recoverable failure in name resolution (Socket::Error)`, but I found no pair of domains that work.\r\n\r\nThe odd thing is that I was unable to reproduce it on other machines. But still looks to be a crystal issue because every other program works and I don't think I have any fancy configuration.\r\n\r\nI'm running Linux, Fedora 23, 64-bit."},"comment":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments/222170574","html_url":"https://github.com/crystal-lang/crystal/issues/2568#issuecomment-222170574","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2568","id":222170574,"user":{"login":"jhass","id":141294,"avatar_url":"https://avatars.githubusercontent.com/u/141294?v=3","gravatar_id":"","url":"https://api.github.com/users/jhass","html_url":"https://github.com/jhass","followers_url":"https://api.github.com/users/jhass/followers","following_url":"https://api.github.com/users/jhass/following{/other_user}","gists_url":"https://api.github.com/users/jhass/gists{/gist_id}","starred_url":"https://api.github.com/users/jhass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhass/subscriptions","organizations_url":"https://api.github.com/users/jhass/orgs","repos_url":"https://api.github.com/users/jhass/repos","events_url":"https://api.github.com/users/jhass/events{/privacy}","received_events_url":"https://api.github.com/users/jhass/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T15:04:16Z","updated_at":"2016-05-27T15:04:16Z","body":"Closing in favor of #2660 "}}
{"actor":{"display_login":"jhass"}}