[ZODB-Dev] killing ?zombie? DB.connections safe?

Júlio Dinis Silva juliodinis@hotmail.com
Thu, 15 Feb 2001 22:29:15 -0000


Hi,

I have this external method:

def killZODBzombies():
	#DONT USE THIS CODE IF YOU DONT KNOW WHAT YOU ARE DOING!!!

        import Globals
        import ZODB
        from ZODB import DB
        from ZODB import Connection
        connlist = []
        pools,pooll=Globals.DB._pools
        for version, (pool, allocated, lock) in pools.items():
                for c in allocated:
                        try:
                                c.close()
                                connlist.append(c)
                        except:
                                pass

        return connlist

My idea is to find a way to kill ZODB connections that are running
for long time(days). This code kills all existing zodb connections,
I will put some stuff to just kill long running ones. It works
for me, i.e, it kills long running connections but I would
like to hear from you zope gurus other ways to do this, and comments
on probably bad things this code can do to Data.fs.

I would like to know if this is safe to do with a ZEO
setup since zeo uses the custom_zodb.py.

Thanx for comments,
Júlio Silva







_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.