Re: Potential deadlock in psp.py

2005-06-24 Thread Gregory (Grisha) Trubetskoy
On Fri, 24 Jun 2005, Jim Gallacher wrote: Gregory (Grisha) Trubetskoy wrote: Yeah, we've got to be inline with the HTTP Project - prefork is the default on unix systems, so we have to abide by it... So I guess the solution is that we need to reserve two locks instead of just one? It se

Re: Potential deadlock in psp.py

2005-06-24 Thread Jim Gallacher
Gregory (Grisha) Trubetskoy wrote: Yeah, we've got to be inline with the HTTP Project - prefork is the default on unix systems, so we have to abide by it... So I guess the solution is that we need to reserve two locks instead of just one? It seems a shame to waste locks if they are not goi

Re: Potential deadlock in psp.py

2005-06-23 Thread Nicolas Lehuen
Well, why not keep the 32 session locks for sessions, and add something to the locking API so that we can create dedicated locks for dedicated usages (the session database lock, the PSP cache lock...) ? The next time someone will need a dedicated lock, he will be tempted to rely on the current im

Re: Potential deadlock in psp.py

2005-06-23 Thread Gregory (Grisha) Trubetskoy
Yeah, we've got to be inline with the HTTP Project - prefork is the default on unix systems, so we have to abide by it... So I guess the solution is that we need to reserve two locks instead of just one? Grisha On Thu, 23 Jun 2005, Jim Gallacher wrote: Nicolas Lehuen wrote: Hi Jim, Unt

Re: Potential deadlock in psp.py

2005-06-23 Thread Jim Gallacher
Nicolas Lehuen wrote: Hi Jim, Until now, we suspected that the way global locks are handled could be deadlock prone. You have just proved it. I know that global locks are expensive on some systems, especially if we want to use them in a multiprocess (forked) environment. That's why we are force

Re: Potential deadlock in psp.py

2005-06-23 Thread Jim Gallacher
Jim Gallacher wrote: Gregory (Grisha) Trubetskoy wrote: Is this reproducable? With a 1 in 31 chance it should be pretty easy to reproduce... Just want to make sure that there isn't some undrelying reason why this was done this way. The supposition that there is a deadlock is untested and

Re: Potential deadlock in psp.py

2005-06-23 Thread Nicolas Lehuen
I think I just spotted a potential deadlock in psp.py. > > def dbm_cache_store(srv, dbmfile, filename, mtime, val): > > dbm_type = dbm_cache_type(dbmfile) > _apache._global_lock(srv, "pspcache") > try: > dbm = dbm_type.open(dbmfile, 'c'

Re: Potential deadlock in psp.py

2005-06-23 Thread Jim Gallacher
potential deadlock in psp.py. def dbm_cache_store(srv, dbmfile, filename, mtime, val): dbm_type = dbm_cache_type(dbmfile) _apache._global_lock(srv, "pspcache") try: dbm = dbm_type.open(dbmfile, 'c') dbm[filename] = "%d %s" % (mtime, code2str

Re: Potential deadlock in psp.py

2005-06-23 Thread Gregory (Grisha) Trubetskoy
Is this reproducable? With a 1 in 31 chance it should be pretty easy to reproduce... Just want to make sure that there isn't some undrelying reason why this was done this way. Grisha On Thu, 23 Jun 2005, Jim Gallacher wrote: I think I just spotted a potential deadlock in psp.py.