Subject: | Template::Stash::XS not thread safe in 2.22 |
Date: | Tue, 17 Jan 2012 15:20:01 -0500 |
To: | bug-Template-Toolkit [...] rt.cpan.org |
From: | Jim Nelson <jim [...] broadtime.com> |
Replacing Template::Stash with Template::Stash::XS in version 2.22 is creating several hard-to-duplicate errors when run in a
mutithreaded Apache instance. We have been dealing with random templates being polluted with data from other pages (wrong photos,
incorrect flags in templates) ever since configuring Template::Stash::XS. Removing that configuration stopped the template variable
pollution.
Instrumenting our wrapper object for Template Toolkit showed that the stash object being passed in was constructed correctly, and
did not have any extra data in it, but once the Template->process() function is called, what is rendered out to the page (using
Template::Plugin::Stash and Template::Plugin::Dumper) includes variables from pages being rendered in another thread. This is
incredibly inconsistent, unfortunately - I don't know how to write a test case for this kind of cross-thread pollution.