Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-10286

When a site has no active connections, it should be removed from the pool.

    XMLWordPrintable

Details

    • Task
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.14.0
    • None
    • None
    • Coremunity
    • Platform Core KANBAN
    • Bug Fix
    • Very minor reduction in memory usage when the last connection from the http pool is borrowed and never returned.
    • Needs Assessment

    Description

      Spurred from conversation in https://github.com/puppetlabs/puppet/pull/7968

      when closing a connection, if a site has no sessions associated with it, the site should be removed from the pool.

      pool with an active connectin:

      > pool
      => #<Puppet::Network::HTTP::Pool:0x00007f84fdd21110
       @factory=#<Puppet::Network::HTTP::Factory:0x00007f84fdd210c0>,
       @keepalive_timeout=15,
       @pool=
        {#<Puppet::Network::HTTP::Site:0x00007f84fdd21228
          @host="rubygems.org",
          @port=443,
          @scheme="https">=>
          [#<Puppet::Network::HTTP::Session:0x00007f84fdd20e40
            @connection=#<Net::HTTP https://rubygems.org:443:80 open=true>,
            @expiration_time=2020-02-07 14:58:31 -0800>]}>
      

      versus pool after the only connection has been closed:

      > pool
      => #<Puppet::Network::HTTP::Pool:0x00007f84fdd21110
       @factory=#<Puppet::Network::HTTP::Factory:0x00007f84fdd210c0>,
       @keepalive_timeout=15,
       @pool=
        {#<Puppet::Network::HTTP::Site:0x00007f84fdd21228
          @host="rubygems.org",
          @port=443,
          @scheme="https">=>[]}>
      

      notice to access the connections, we need to call pool.pool, which is confusing.

      Attachments

        Activity

          People

            josh Josh Cooper
            melissa Melissa Stone
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support