HomePhorge

(PUP-2659) Synchronize all webrick requests.
4744a7f9deb5Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

(PUP-2659) Synchronize all webrick requests.

Puppet had some scattered thread safety code, which was removed in
4da350b, because Puppet itself is not using threads. However, Webrick
starts a new thread to handle each incoming request. This was probably
causing subtle problems during simultaneous requests to a webrick
master, but since 3.6.1 the issue became much more noticeable due to the
fix for PUP-2610 merged in 0dc5ad3 which was fixing a case where rack
masters would lose track of newly established environment loaders using
the master settings. The change to Puppet::Context used a new
mark/rollback method for overriding context making it very obvious when
concurrent threads would collide attempting to rollback the same marker
and exhaust the context stack.

We are fixing this by synchronizing around incoming webrick requests,
effectively serializing their access to Puppet's innards. Initial
manual benchmarking did not show a significant decrease in performance,
probably because Ruby uses green threads handled by the vm which cannot
take advantage of multiple processors.

Details

Event Timeline

Josh Partlow <joshua.partlow@puppetlabs.com> committed rPU4744a7f9deb5: (PUP-2659) Synchronize all webrick requests. (authored by Josh Partlow <joshua.partlow@puppetlabs.com>).May 30 2014, 1:11 AM