migurski/TileStache — pull request #97 by bwg (2013-02-15 22:38:38+00:00)
Title: release global_mapnik_lock when mapnik throws exception

When Mapnik throws an exception after lock is acquired (like when a postgres conn dies), the lock is never released and other workers will wait indefinitely for a lock that will never be released.

This patch wraps the mapnik logic in a try/except/finally block with the global_mapnik_lock.release() in the finally so the lock is always released.