quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Lehuen <nicolas.leh...@gmail.com>
Subject Re: FileSession - a couple of small fixes
Date Tue, 12 Apr 2005 06:19:20 GMT
On Apr 12, 2005 6:48 AM, Jim Gallacher <jim@jgassociates.ca> wrote:
> I've made a couple of small changes to FileSession.
> 
> 1. _fast_timeout now uses Session.DFT_TIMEOUT when timeout=0
> 
> 2. Fixed stupid indent error in do_cleanup method.
> 
> 3. Added comments to do_cleanup method to highlight possible
> file/session locking issues.
> 
> 4. Removed some log_error calls that slipped in from my  debugging version.
> 
> Patch is attached. Is there any sort of convention for patch file naming?
> 
> Jim

Hi Jim,

OK, I've integrated your fixes.

Regarding the do_cleanup locking issue, I had two ideas in mind :

1) Hold the lock n° 0 (AKA the "dbm lock") while doing the cleanup to
prevent two concurrent cleanups in the case we are very unlucky (two
cleanups triggered at the same time). More than that, we should try to
hold the lock with an APR try_lock call (which I think is not
implemented yet in _apache.c), so that if the lock is currently held,
we know that a cleanup is already being performed, so we can safely
skip it.

2) while the cleanup is being performed, hold the lock on each session
with a try_lock call, so that if a session is locked, it will never be
candidate for a cleanup.

Regards,
Nicolas

Mime
View raw message