mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
The issue was that inherited socket was added to the @unix_paths list even if it was pre-existing. Test added. Closed #2816.
This commit is contained in:
parent
bdbd46ebbc
commit
eb59ed00d7
2 changed files with 21 additions and 1 deletions
|
@ -189,7 +189,7 @@ module Puma
|
|||
end
|
||||
|
||||
if fd = @inherited_fds.delete(str)
|
||||
@unix_paths << path unless abstract
|
||||
@unix_paths << path unless abstract || File.exist?(path)
|
||||
io = inherit_unix_listener path, fd
|
||||
log_writer.log "* Inherited #{str}"
|
||||
elsif sock = @activated_sockets.delete([ :unix, path ]) ||
|
||||
|
|
|
@ -43,6 +43,26 @@ class TestIntegrationCluster < TestIntegration
|
|||
end
|
||||
end
|
||||
|
||||
def test_pre_existing_unix_stop_after_restart
|
||||
skip_unless :unix
|
||||
|
||||
File.open(@bind_path, mode: 'wb') { |f| f.puts 'pre existing' }
|
||||
|
||||
cli_server "-w #{workers} -q test/rackup/sleep_step.ru", unix: :unix
|
||||
connection = connect(nil, unix: true)
|
||||
restart_server connection
|
||||
|
||||
connect(nil, unix: true)
|
||||
stop_server
|
||||
|
||||
assert File.exist?(@bind_path)
|
||||
|
||||
ensure
|
||||
if UNIX_SKT_EXIST
|
||||
File.unlink @bind_path if File.exist? @bind_path
|
||||
end
|
||||
end
|
||||
|
||||
def test_siginfo_thread_print
|
||||
skip_unless_signal_exist? :INFO
|
||||
|
||||
|
|
Loading…
Reference in a new issue