Skip to content

Commit

Permalink
Merge pull request #640 from key-amb/topic/close-sock
Browse files Browse the repository at this point in the history
Close kgio socket after IO.select timeouts
  • Loading branch information
petergoldstein committed Jan 23, 2017
2 parents 0af0200 + 17c08cb commit 079f326
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 079f326

Please sign in to comment.