1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Fix Binder @unix_paths handling

1. Move removal to launcher from single and cluster.

2. @unix_paths only contains files that Puma creates (pre-existing files are not)
This commit is contained in:
MSP-Greg 2019-10-01 08:50:38 -05:00
parent 3adff9e21d
commit 1a484d8d1c
4 changed files with 5 additions and 9 deletions

View file

@ -361,7 +361,7 @@ module Puma
# Tell the server to listen on +path+ as a UNIX domain socket.
#
def add_unix_listener(path, umask=nil, mode=nil, backlog=1024)
@unix_paths << path
@unix_paths << path unless File.exist? path
# Let anyone connect by default
umask ||= 0
@ -399,7 +399,7 @@ module Puma
end
def inherit_unix_listener(path, fd)
@unix_paths << path
@unix_paths << path unless File.exist? path
if fd.kind_of? TCPServer
s = fd
@ -420,7 +420,8 @@ module Puma
io.close
uri = URI.parse(l)
next unless uri.scheme == 'unix'
File.unlink("#{uri.host}#{uri.path}")
unix_path = "#{uri.host}#{uri.path}"
File.unlink unix_path if @unix_paths.include? unix_path
end
end

View file

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

View file

@ -184,6 +184,7 @@ module Puma
when :exit
# nothing
end
@binder.close_unix_paths
end
# Return which tcp port the launcher is using, if it's using TCP
@ -204,10 +205,6 @@ module Puma
@binder.close_listeners
end
def close_binder_unix_paths
@binder.close_unix_paths
end
private
# If configured, write the pid of the current process out

View file

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