Skip to content

Commit

Permalink
Close sock when IO.select timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
key-amb committed Dec 1, 2016
1 parent 7174673 commit 17c08cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/dalli/socket.rb
Expand Up @@ -64,6 +64,9 @@ def self.open(host, port, server, options = {})
sock.server = server
sock.kgio_wait_writable
sock
rescue Timeout::Error
sock.close if sock
raise
end
end

Expand All @@ -75,6 +78,9 @@ def self.open(path, server, options = {})
sock.server = server
sock.kgio_wait_writable
sock
rescue Timeout::Error
sock.close if sock
raise
end
end

Expand Down

0 comments on commit 17c08cb

Please sign in to comment.