On Wed, 2007-03-14 at 21:39 +0000, Jeff Forcier wrote: > Greets all, > > Been having the most bizarre issue for quite some time now; it seems > as if the 'kwargs' portion of various URLpattern objects/views are > 'bleeding' into one another once the server has been under moderate > load for at least a short period. > > I will have e.g. a specific view that displays/processes a form, whose > template context will intermittently become corrupted and contain > information that belongs in *other views' contexts*. For example, the > context contains a couple objects, such as session username and object > being edited, but then it will sometimes end up with those objects *in > addition to* an object_list that comes from a list view, or a > 'no_javascript' boolean that I set in some views to disable a template > level Dojo include. > > This problem only crops up after the server has handled at least a few > dozen requests, and even then is only intermittent - I can load the > same form a dozen times and the incorrect context appears 2-3 times, > sometimes with different sets of incorrect info. > > I have debugged the issue as best I can and it appears to reside in > django.core.urlresolvers.RegexURLPattern - these objects set up their > 'default_args' attribute when initialized (always correct at that > point), and then refer to that value in their 'resolve()' method (at > which point the corruption appears). > > I can't find any bug reports or mailing list posts about this issue, > and while I plan to file a ticket I wanted to post to see if anyone > had any other bright ideas. This issue occurs with 0.91 and 0.95.1, > with mod_python as well as the development runserver, always Python2.4 > (on varying Gentoo systems, fwiw).
Can you post an example of the sort of urlpatterns -- with the arguments -- you have that are failing, please? There's nothing in urlresolvers.py that should be causing this problem (all the default argument use is thread-safe) but I'm wondering if you are using mutable types as your default arguments and then modifying them in place (the equivalent of "def foo(somearg = []):..."), which is a bad idea for just the reasons you are seeing. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---