Changeset 1621

Show
Ignore:
Timestamp:
11/09/08 19:57:28 (2 months ago)
Author:
peet
Message:

track all messages in watchdogs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.4.7/shell/state/ddb.py

    r1617 r1621  
    2929from cxcore.manager import CoreThread,ACoreService,public,tail 
    3030from cxcore.logger import log 
     31from cxcore.cxnetlink import CX_MSG_TRACK 
    3132from cxutil.utils import opts, merge, intersection, exclusion 
    3233from cxutil.exceptions import CommitRaise,CallPass,CallQueue,BranchPass 
     
    294295                        self.log("debug","DB resync request for host `%s`" % (hostname)) 
    295296 
    296                         x = ACoreService(self.bus,"%s@%s" % (self.prefix, hostname)
     297                        x = ACoreService(self.bus,"%s@%s" % (self.prefix, hostname),flags=CX_MSG_TRACK
    297298                        x.dumpDB() 
    298299 
    299300                        if self.sync[hostname] > 0: 
    300301                                self.log("debug","DB resync watchdog for host `%s` started with ttl `%s`" % (hostname,self.sync[hostname])) 
    301                                 Timer(1,self._resync,(hostname,)).start() 
     302                                Timer(10,self._resync,(hostname,)).start() 
    302303                        else: 
    303304                                self.log("debug","DB resync watchdog: low watermark touch") 
     
    641642                else: 
    642643                        ring = self.mdns.lookupPTR(domain) 
    643                         return filter(lambda x: x != exclude, ring) 
     644                        return filter(lambda x: x[0] != exclude, ring) 
    644645 
    645646        @public 
     
    688689                        if node.async[hostname] > 0: 
    689690                                self.log("debug","Node sync watchdog for host `%s` started with ttl `%s`" % (hostname,node.async[hostname])) 
    690                                 Timer(2,self._t_add,(host,primer)).start() 
    691                                 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname)
     691                                Timer(10,self._t_add,(host,primer)).start() 
     692                                x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK
    692693                        else: 
    693694                                self.log("critical","Node sync (add) watchdog: low watermark touch; mark node as stale") 
    694                                 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK) 
     695                                del node.async[hostname] 
     696                                x = ACoreService(self.bus, self.bus.address) 
     697                                x.nop() 
     698                                return 
    695699                        x._add(primer) 
    696700                else: 
     
    714718                        if node.usync[hostname] > 0: 
    715719                                self.log("debug","Node sync watchdog for host `%s` started with ttl `%s`" % (hostname,node.usync[hostname])) 
    716                                 Timer(2,self._t_update,(host,primer)).start() 
    717                                 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname)
     720                                Timer(10,self._t_update,(host,primer)).start() 
     721                                x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK
    718722                        else: 
    719723                                self.log("critical","Node sync (update) watchdog: low watermark touch; mark node as stale") 
    720                                 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK) 
     724                                del node.usync[hostname] 
     725                                x = ACoreService(self.bus, self.bus.address) 
     726                                x.nop() 
     727                                return 
    721728                        x._update(primer) 
    722729                else: 
     
    739746                        if node.dsync[hostname] > 0: 
    740747                                self.log("debug","Node sync watchdog for host `%s` started with ttl `%s`" % (hostname,node.dsync[hostname])) 
    741                                 Timer(2,self._t_del,(host,index)).start() 
    742                                 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname)
     748                                Timer(10,self._t_del,(host,index)).start() 
     749                                x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK
    743750                        else: 
    744751                                self.log("critical","Node sync (del) watchdog: low watermark touch; mark node as stale") 
    745                                 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK) 
     752                                del node.dsync[hostname] 
     753                                x = ACoreService(self.bus, self.bus.address) 
     754                                x.nop() 
     755                                return 
    746756                        x._del(index) 
    747757                else: 
     
    768778                while True: 
    769779                        self.log("debug","existing htable: `%s`" % (self.htable)) 
    770                         if not node.watch.keys(): 
     780                        if not node.dsync.keys(): 
    771781 
    772782                                yield node.dconfirmed.values() 
     
    813823                while True: 
    814824                        self.log("debug","existing htable: `%s`" % (self.htable)) 
    815                         if not node.watch.keys(): 
     825                        if not node.usync.keys(): 
    816826                                yield node.uconfirmed.values() 
    817827                                return 
     
    893903                while True: 
    894904                        self.log("debug","existing htable: `%s`" % (self.htable)) 
    895                         if not node.watch.keys(): 
     905                        if not node.async.keys(): 
    896906 
    897907                                for i in self.nodeset["weak"]: