Skip to content

Commit

Permalink
(maint) Remove unneeded Timeout module workaround
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
justinstoller committed Mar 13, 2023
1 parent 113bc7c commit d8b3a44
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/ruby/puppetserver-lib/puppet/server/master.rb
Expand Up @@ -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
Expand Down

0 comments on commit d8b3a44

Please sign in to comment.