Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 937

Show
Ignore:
Timestamp:
01/25/06 03:11:08
Author:
rdelon
Message:

Catch case where clean_up is called by 2 concurrent threads

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/filters/sessionfilter.py

    r934 r937  
    233233                toBeDeleted.append(id) 
    234234        for id in toBeDeleted: 
    235             sess.onDeleteSession(cherrypy._session_data_holder[id]) 
    236             del cherrypy._session_data_holder[id] 
     235            try: 
     236                del cherrypy._session_data_holder[id] 
     237                sess.onDeleteSession(cherrypy._session_data_holder[id]) 
     238            except KeyError: 
     239                # The session probably got deleted by a concurrent thread 
     240                #   Safe to ignore this case 
     241                pass 
    237242 
    238243 

Hosted by WebFaction

Log in as guest/cpguest to create tickets