HomePhorge

Fix for #4955 -- Race condition & memory leak in Puppet::Util
ee61b4ecec7dUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fix for #4955 -- Race condition & memory leak in Puppet::Util

The Puppet::Util.sync method was not thread safe and also leaked memory. I'm
not certain, but I believe the first is ironic and the second is merely a bug.

This patch addresses the problem by 1) refactoring so the sync objects
are never returned (and thus no one can cache a reference to one) 2) adding
reference counting 3) deleting them when they are no longer needed 4) doing
the thread safty dance.

It wasn't the first (or even second) solution considered, but it's the one
that I was able to make work in a way that I'm convinced is correct. Its
main advantage is that it puts all the tricky bits in one place.

Details

Provenance
Markus Roberts <Markus@reality.com>Authored on
James Turnbull <james@lovedthanlost.net>Committed on Nov 11 2010, 6:05 PM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUf57425da6aee: Fix #4921 - race condition in Parser Functions creation
Branches
Unknown
Tags
Unknown

Event Timeline

James Turnbull <james@lovedthanlost.net> committed rPUee61b4ecec7d: Fix for #4955 -- Race condition & memory leak in Puppet::Util (authored by Markus Roberts <Markus@reality.com>).Nov 11 2010, 6:05 PM