From d8b3a44a96f17214d434a3841887aa2e00e0546f Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Mon, 13 Mar 2023 13:59:01 -0700 Subject: [PATCH] (maint) Remove unneeded Timeout module workaround In JRuby 9.4.0 & 9.4.1 there was an issue when shutting down threads, if JRuby encountered an adopted thread it would stop its thread shutdown procedure and any abandoned threads would be leaked. This was particularly problematic because the Timeout module does not attempt to shutdown its watcher thread and Puppet Server adopts a Jetty thread as part of processing incoming requests, so we would consistently leak Timeout threads when flushing a JRuby. To work around this issue while we tested our JRuby upgrade we manually killed the Timeout watcher thread. This was not a vialable solution to ship with, but allowed us to see how much work the move to a Ruby 3 compatible would be. With JRuby 9.4.2 the issue is resolved and we can remove the workaround. --- src/ruby/puppetserver-lib/puppet/server/master.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ruby/puppetserver-lib/puppet/server/master.rb b/src/ruby/puppetserver-lib/puppet/server/master.rb index d5f1110f6e..1b33dcbf3b 100644 --- a/src/ruby/puppetserver-lib/puppet/server/master.rb +++ b/src/ruby/puppetserver-lib/puppet/server/master.rb @@ -162,8 +162,6 @@ def run_mode() def terminate Puppet::Server::Config.terminate_puppet_server - # See https://github.com/jruby/jruby/issues/7349 - Timeout.instance_variable_get(:@timeout_thread)&.exit end # @return [Array, nil] an array of hashes describing tasks