1
0
Fork 0
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:
MSP-Greg 2019-09-18 04:51:59 -05:00 committed by Nate Berkopec
parent 7e704b553c
commit db74ad4ab2
4 changed files with 10 additions and 8 deletions

View file

@ -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|

View file

@ -527,6 +527,7 @@ module Puma
@suicide_pipe.close
read.close
@wakeup.close
@launcher.close_binder_unix_paths
end
end

View file

@ -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

View file

@ -118,6 +118,7 @@ module Puma
rescue Interrupt
# Swallow it
end
@launcher.close_binder_unix_paths
end
end
end