Solved!

Of course It was my code that was causing it!
Python, apache, django (old or new version) mod_python, fastcgi are
all innocent.

What was it?

RESPONSE_OBJECT = None
def my_view(request):
  ...blah..
  global REPOSNE_OBJECT
  if not RESPONSE_OBJECT:
    RESPONSE_OBJECT = HttpResponse()
    ...blah...
  return RESPONSE_OBJECT

All fine and dandy the response object gets saved for future users to
re-use. Which is what I wanted sine the response object in question
just holds a meaningless 1x1 transparent gif that is used for tracking
purposes.

But the response object also stores the session_id cookie of the user
that happens to be the first one to hit that view.

Symptoms: The problem only ever happens for real users (stress testing
tools won't cut it unless they can also download images and consider
the cookies that those images might send. Also if you are just few
users hitting the dev site it might take days for this to manifest
itself.

I know - silly me for caching the HttpResponse object like that.

Thanks to everybody that tried to help!

Finally I'd like to say that I was only able to track down this
problem due to open source nature of django and the fact that I was
able to insert logging statements everywhere and eventually caught the
problem when I started logging raw request and response headers.

Best Regards

On 12/4/06, Jakub Labath <[EMAIL PROTECTED]> wrote:
> No I'm using prefork MPM.
>
> On 12/3/06, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
> >
> >
> > Jakub Labath wrote:
> > > Hi All,
> > >
> > > Sorry for being quiet for a while just got back from a vacation.
> > >
> > > >
> > > > Hi Jakub,
> > > >
> > > > Do you have any updates on this problem? Was it a mod_python bug?
> > > >
> > > > Adrian
> > > >
> > >
> > > No the problem persists and I noticed that my coworkers have not
> > > resolved this in my absence. I'm still not sure what the problem is,
> > > as I mentioned to Jacob and on modpython list my next move is building
> > > a tool that simulates bunch of users log-in and out of admin and
> > > seeing if two different users get send the same cookie. This should
> > > give me more reliable way to reproduce the problem quickly ... then
> > > I'll take it from there.
> > > Should I find something I will contact one of the core devs directly,
> > > but so far I don't even know what is going on all I really know is
> > > that it is happening.
> > >
> > > As for trying fcgi instead of modpython that is definitively on a to
> > > do list but two weeks ago I spent ridiculous amount of time switching
> > > our production server from debian to gentoo hoping to solve the
> > > problem quickly by using more recent software - that did not happen.
> > > At this point I really need a tool to reproduce the problem quickly
> > > and then debug the hell out of everything.
> >
> > One question for you about this, are you using Apache with a
> > multithreaded MPM? In other words, is Apache compiled with the 'worker'
> > MPM for UNIX?
> >
> > I ask as a separate thread on the list describes pushing data into
> > os.environ in order to communicate information to Django from a custom
> > mod_python wrapper handler. To me though, doing such a thing could
> > cause problems and makes me wander how much Django may depend on
> > sourcing configuration from os.environ as doing this in a multithreaded
> > MPM may not work as distinct requests could interfere with each other
> > due to using what is effectively global data with no thread protection
> > and no way to stop a distinct thread from changing values before the
> > first thread got to use them.
> >
> > Graham
> >
> >
> > > >
> >
>
>
> --
> Jakub Labath
>


-- 
Jakub Labath

--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to