Skip to content
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

Don't use the systemd plugin on JRuby #3079

Merged
merged 6 commits into from Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/puma/launcher.rb
Expand Up @@ -59,7 +59,10 @@ def initialize(conf, launcher_args={})

@environment = conf.environment

if ENV["NOTIFY_SOCKET"]
# Load the systemd integration if we detect systemd's NOTIFY_SOCKET.
# Skip this on JRuby though, because it is incompatible with the systemd
# integration due to https://github.com/jruby/jruby/issues/6504
if ENV["NOTIFY_SOCKET"] && !Puma.jruby?
@config.plugins.create('systemd')
end

Expand Down
27 changes: 27 additions & 0 deletions test/test_plugin_systemd_jruby.rb
@@ -0,0 +1,27 @@
require_relative "helper"
require_relative "helpers/integration"

class TestPluginSystemdJruby < TestIntegration

THREAD_LOG = TRUFFLE ? "{ 0/16 threads, 16 available, 0 backlog }" :
"{ 0/5 threads, 5 available, 0 backlog }"

def setup
skip "Skipped because Systemd support is linux-only" if windows? || osx?
mohamedhafez marked this conversation as resolved.
Show resolved Hide resolved
skip_unless :unix
skip_unless_signal_exist? :TERM
skip_unless :jruby

super

ENV["NOTIFY_SOCKET"] = "/tmp/doesntmatter"
end

def test_systemd_plugin_not_loaded
cli_server "test/rackup/hello.ru"

assert_nil Puma::Plugins.instance_variable_get(:@plugins)["systemd"]

stop_server
end
end