Open mafgh opened 2 months ago
There is a memory leak when using Net::HTTP with ca_file to access a https:// URL in a custom function.
Removing the ca_file parameter, the leak is no longer visible.
No memory leak.
Call something like this in a manifest:
require 'net/http' require 'uri' module Puppet::Parser::Functions newfunction(:foo, :type => :rvalue)) do |args| uri = URI('https://foo.com') response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true, :verify_mode = OpenSSL::SSL::VERIFY_PEER, :ca_file => '/etc/pki/tls/certs/ca-bundle.trust.crt', ) do |http| http.request(request) end return "" end end
RHEL9
puppet-agent-8.6.0-1.el9.x86_64 puppetdb-8.5.0-1.el9.noarch puppetdb-termini-8.5.0-1.el9.noarch puppetserver-8.6.1-1.el9.noarch
openjdk 17.0.9 2023-10-17 LTS
I found https://bugs.ruby-lang.org/issues/15082#note-5, however I don't know if it's related.
The setup has 73 Agents, all with default runinterval. After ~25 hours it would OOM with 10GiB of JVM heap configured.
Describe the Bug
There is a memory leak when using Net::HTTP with ca_file to access a https:// URL in a custom function.
Removing the ca_file parameter, the leak is no longer visible.
Expected Behavior
No memory leak.
Steps to Reproduce
Call something like this in a manifest:
Environment
RHEL9
puppet-agent-8.6.0-1.el9.x86_64 puppetdb-8.5.0-1.el9.noarch puppetdb-termini-8.5.0-1.el9.noarch puppetserver-8.6.1-1.el9.noarch
openjdk 17.0.9 2023-10-17 LTS
Additional Context
I found https://bugs.ruby-lang.org/issues/15082#note-5, however I don't know if it's related.
The setup has 73 Agents, all with default runinterval. After ~25 hours it would OOM with 10GiB of JVM heap configured.