puppetlabs/puppet — pull request #2863 by joshcooper (2014-07-11 08:09:28+00:00)
Title: Do Not Merge

This adds support `puppet agent` and `puppet apply` to use persistent http connections for all HTTP connections, e.g. catalog, pluginsync, remote file sources, reports. This is most noticeable when pluginsyncing many small files, e.g. facts, as previously, puppet would make a new HTTP connection (TCP and SSL handshake) for every file.

Do not merge this yet, as there are still some issues to account for:

1. The agent may want a VERIFY_PEER connection, but reuse a VERIFY_NONE connection, and vice-versa. These connections need to be isolated.
2. The default pool implementation may not work with custom http client classes.
3. The caching pool timeout is not configurable.
4. There are no API docs describing which methods are private
5. The Puppet::Network::HTTP::Connection#connection private method is dubious, and should probably be removed.
6. We probably don't need to monkey patch Net::HTTP to include a `:ca_file` accessor anymore.
7. Our handling of 302 and 307 temporary move response codes doesn't seem correct.
8. There are 2 pending tests that we need to talk about.