mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
unlink UNIXSocket files, fix Binder#close (#1970)
This commit is contained in:
parent
7e704b553c
commit
db74ad4ab2
4 changed files with 10 additions and 8 deletions
|
@ -50,14 +50,6 @@ module Puma
|
|||
|
||||
def close
|
||||
@ios.each { |i| i.close }
|
||||
@unix_paths.each do |i|
|
||||
# Errno::ENOENT is intermittently raised
|
||||
begin
|
||||
unix_socket = UNIXSocket.new i
|
||||
unix_socket.close
|
||||
rescue Errno::ENOENT
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def import_from_env
|
||||
|
@ -431,6 +423,10 @@ module Puma
|
|||
end
|
||||
end
|
||||
|
||||
def close_unix_paths
|
||||
@unix_paths.each { |up| File.unlink(up) if File.exist? up }
|
||||
end
|
||||
|
||||
def redirects_for_restart
|
||||
redirects = {:close_others => true}
|
||||
@listeners.each_with_index do |(l, io), i|
|
||||
|
|
|
@ -527,6 +527,7 @@ module Puma
|
|||
@suicide_pipe.close
|
||||
read.close
|
||||
@wakeup.close
|
||||
@launcher.close_binder_unix_paths
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -220,6 +220,10 @@ module Puma
|
|||
@binder.close_listeners
|
||||
end
|
||||
|
||||
def close_binder_unix_paths
|
||||
@binder.close_unix_paths
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def reload_worker_directory
|
||||
|
|
|
@ -118,6 +118,7 @@ module Puma
|
|||
rescue Interrupt
|
||||
# Swallow it
|
||||
end
|
||||
@launcher.close_binder_unix_paths
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue