[Dancer-users] route_cache breaks with multiple parameters

sawyer x xsawyerx at gmail.com
Wed May 19 02:39:29 CEST 2010


On Wed, May 19, 2010 at 3:30 AM, sawyer x <xsawyerx at gmail.com> wrote:

>
> It seems like the match() function is matching /name/bob and /name/bill and
> changing the parameter of :name to "bill" from "bob".
> Since we're working with references here and the cache uses references to
> keep track, it means that it affects the cache as well.
> When it tries to store "/name/bill" as a new value, it sees that the
> reference to "/name/bob" now points to whatever "/name/bill" is suppose to
> so it aliases the key of "bill" in the cache to that of "bob".
>

More digging shows that match() probably matches a path to a route reference
and then just changes the content from the request and passes it along. This
worked out just fine for the past but with caching and references this gets
you a race condition that cannot be helped.

I was able to fix it by creating a reference to a new hash, copying the
details and continuing along with it.
However, this caused a few tests to fail, so tomorrow I'll go over the
failing tests and if I can resolve everything, I'll commit the changes and
close the ticket.

Again, thank you for the attention and test! :)

Sawyer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20100519/03437b75/attachment.htm>


More information about the Dancer-users mailing list