[ZODB-Dev] killing zodb zombies

Júlio Dinis Silva juliodinis@hotmail.com
Tue, 20 Feb 2001 13:51:52 -0000


Hi,

Its a fact that almost all zope crashes are related to one's 
application(ZODB) problems then ZServer problems. I tryed to kill zombie 
threads(you can see them on /Control_Panel/DebugInfo/manage) but I couldnt 
do that using ZSERVER kill_zombies code.

Then searching a little more I found that the debuginfo we
get on DebugInfo are the open ZODB connections and not Zserver channels, 
well actually they could/are be the same but in cases
you have a thread running for days chances are that zserver
no longer have a open channel for that zodb connection and
thus that zombie fellow is only a zodb zombie connection.

I made an external method to kill the bastards:

def killZODBzombies():
	#Dont use this code unless you know what you are doing.
	#this can damage/lost your data

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

        return connslist

This code really kills the zombies threads but what I think this
does is also to put your zope running with only one connection
to zodb instead of the default 7. But I need some guru comments
on this.

Thanx for comments,
Julio Dinis Silva
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.