New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix systemd unix path handling #2007
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -529,7 +529,6 @@ def run | |
@suicide_pipe.close | ||
read.close | ||
@wakeup.close | ||
@launcher.close_binder_unix_paths | ||
end | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,6 @@ def run | |
rescue Interrupt | ||
# Swallow it | ||
end | ||
@launcher.close_binder_unix_paths | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,23 @@ def test_allows_both_tcp_and_unix | |
assert_parsing_logs_uri [:tcp, :unix] | ||
end | ||
|
||
def test_pre_existing_unix | ||
skip UNIX_SKT_MSG unless UNIX_SKT_EXIST | ||
unix_path = "test/#{name}_server.sock" | ||
|
||
File.open(unix_path, mode: 'wb') { |f| f.puts 'pre eixisting' } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. existing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
@binder.parse ["unix://#{unix_path}"], @events | ||
|
||
assert_match %r!unix://#{unix_path}!, @events.stdout.string | ||
|
||
refute_includes @binder.instance_variable_get(:@unix_paths), unix_path | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's also call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
ensure | ||
if UNIX_SKT_EXIST | ||
File.unlink unix_path if File.exist? unix_path | ||
end | ||
end | ||
|
||
private | ||
|
||
def assert_parsing_logs_uri(order = [:unix, :tcp]) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,25 @@ def setup | |
end | ||
|
||
def teardown | ||
super if HAS_FORK | ||
return if skipped? | ||
super | ||
end | ||
|
||
def test_pre_existing_unix | ||
skip UNIX_SKT_MSG unless UNIX_SKT_EXIST | ||
|
||
File.open(@bind_path, mode: 'wb') { |f| f.puts 'pre eixisting' } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. existing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
cli_server "-w #{WORKERS} -t 0:6 -q test/rackup/sleep_step.ru", unix: :unix | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leave out the thread setting, not necessary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's mention "socket activation" and "systemd" explicitly for anyone scanning the changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done