Changeset 1621
- Timestamp:
- 11/09/08 19:57:28 (2 months ago)
- Files:
-
- branches/0.4.7/shell/state/ddb.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.4.7/shell/state/ddb.py
r1617 r1621 29 29 from cxcore.manager import CoreThread,ACoreService,public,tail 30 30 from cxcore.logger import log 31 from cxcore.cxnetlink import CX_MSG_TRACK 31 32 from cxutil.utils import opts, merge, intersection, exclusion 32 33 from cxutil.exceptions import CommitRaise,CallPass,CallQueue,BranchPass … … 294 295 self.log("debug","DB resync request for host `%s`" % (hostname)) 295 296 296 x = ACoreService(self.bus,"%s@%s" % (self.prefix, hostname) )297 x = ACoreService(self.bus,"%s@%s" % (self.prefix, hostname),flags=CX_MSG_TRACK) 297 298 x.dumpDB() 298 299 299 300 if self.sync[hostname] > 0: 300 301 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() 302 303 else: 303 304 self.log("debug","DB resync watchdog: low watermark touch") … … 641 642 else: 642 643 ring = self.mdns.lookupPTR(domain) 643 return filter(lambda x: x != exclude, ring)644 return filter(lambda x: x[0] != exclude, ring) 644 645 645 646 @public … … 688 689 if node.async[hostname] > 0: 689 690 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) 692 693 else: 693 694 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 695 699 x._add(primer) 696 700 else: … … 714 718 if node.usync[hostname] > 0: 715 719 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) 718 722 else: 719 723 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 721 728 x._update(primer) 722 729 else: … … 739 746 if node.dsync[hostname] > 0: 740 747 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) 743 750 else: 744 751 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 746 756 x._del(index) 747 757 else: … … 768 778 while True: 769 779 self.log("debug","existing htable: `%s`" % (self.htable)) 770 if not node. watch.keys():780 if not node.dsync.keys(): 771 781 772 782 yield node.dconfirmed.values() … … 813 823 while True: 814 824 self.log("debug","existing htable: `%s`" % (self.htable)) 815 if not node. watch.keys():825 if not node.usync.keys(): 816 826 yield node.uconfirmed.values() 817 827 return … … 893 903 while True: 894 904 self.log("debug","existing htable: `%s`" % (self.htable)) 895 if not node. watch.keys():905 if not node.async.keys(): 896 906 897 907 for i in self.nodeset["weak"]:
