HomePhorge

(PUP-744) Create a pool of puppet HTTP connections
8556529de5f2Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

(PUP-744) Create a pool of puppet HTTP connections

This commit adds a pool for caching puppet network connections. The pool
maintains a hash indexed by site. Each site refers to an array of
sessions, where each session refers to a puppet HTTP connection and its
timeout.

It is expected the consumers of the pool will follow the pattern:

conn = pool.take_connection(site)
# do something with conn
pool.add_connection(site, conn)

Whenever a connection is (re-)added to the pool, the pool will assign a
expiration timeout. When a caller next requests a connection, the pool
will lazily close any expired connection(s) for that site.

The timeout exists, because if there is a long delay between the time
that an open connection is added to the pool and when it is taken, the
remote peer may close the connection, e.g. apache. As a result, we
only want to cache connections for a short time. Currently the timeout
defaults to 15 seconds.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU0b78ce788a38: (PUP-744) Add dummy http pool
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU8556529de5f2: (PUP-744) Create a pool of puppet HTTP connections (authored by Josh Cooper <josh@puppetlabs.com>).Jul 25 2014, 6:36 PM