Changeset 1624
- Timestamp:
- 11/12/08 15:21:19 (2 months ago)
- Files:
-
- branches/0.4.7/shell/state/ddb.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.4.7/shell/state/ddb.py
r1621 r1624 642 642 else: 643 643 ring = self.mdns.lookupPTR(domain) 644 print ring 644 645 return filter(lambda x: x[0] != exclude, ring) 645 646 … … 679 680 self.log("debug","node: %s" % (node)) 680 681 except: 681 self.log("debug","Node sync watchdog for host `%s` terminated: no such node" % (hostname))682 self.log("debug","Node async watchdog for host `%s` terminated: no such node" % (hostname)) 682 683 return 683 684 684 685 if node.async.has_key(hostname): 685 686 node.async[hostname] -= 1 686 self.log("debug","Node sync request for host `%s`" % (hostname))687 self.log("debug","Node async request for host `%s`" % (hostname)) 687 688 self.log("debug","Sent %s" % (primer.dump())) 688 689 689 if node.async[hostname] > 0: 690 self.log("debug","Node sync watchdog for host `%s` started with ttl `%s`" % (hostname,node.async[hostname])) 691 Timer(10,self._t_add,(host,primer)).start() 692 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK) 690 if node.async[hostname] >= 0: 691 self.log("debug","Node async watchdog for host `%s` started with ttl `%s`" % (hostname,node.async[hostname])) 692 Timer(3,self._t_add,(host,primer)).start() 693 693 else: 694 self.log("critical","Node sync (add) watchdog: low watermark touch; mark node as stale")694 self.log("critical","Node async watchdog: low watermark touch; kick ourself in the ass") 695 695 del node.async[hostname] 696 x= ACoreService(self.bus, self.bus.address)697 x.nop()698 return696 y = ACoreService(self.bus, self.bus.address) 697 y.nop() 698 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK) 699 699 x._add(primer) 700 700 else: 701 self.log("debug","Node sync watchdog for host `%s` terminated: confirmed" % (hostname))701 self.log("debug","Node async watchdog for host `%s` terminated: confirmed" % (hostname)) 702 702 703 703 def _t_update(self,host,primer): … … 708 708 self.log("debug","node: %s" % (node)) 709 709 except: 710 self.log("debug","Node sync watchdog for host `%s` terminated: no such node" % (hostname))710 self.log("debug","Node usync watchdog for host `%s` terminated: no such node" % (hostname)) 711 711 return 712 712 713 713 if node.usync.has_key(hostname): 714 714 node.usync[hostname] -= 1 715 self.log("debug","Node sync request for host `%s`" % (hostname))715 self.log("debug","Node usync request for host `%s`" % (hostname)) 716 716 self.log("debug","Sent %s" % (primer.dump())) 717 717 718 if node.usync[hostname] > 0: 719 self.log("debug","Node sync watchdog for host `%s` started with ttl `%s`" % (hostname,node.usync[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 if node.usync[hostname] >= 0: 719 self.log("debug","Node usync watchdog for host `%s` started with ttl `%s`" % (hostname,node.usync[hostname])) 720 Timer(3,self._t_update,(host,primer)).start() 722 721 else: 723 self.log("critical","Node sync (update) watchdog: low watermark touch; mark node as stale")722 self.log("critical","Node usync watchdog: low watermark touch; kick ourself in the ass") 724 723 del node.usync[hostname] 725 x= ACoreService(self.bus, self.bus.address)726 x.nop()727 return724 y = ACoreService(self.bus, self.bus.address) 725 y.nop() 726 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK) 728 727 x._update(primer) 729 728 else: 730 self.log("debug","Node sync watchdog for host `%s` terminated: confirmed" % (hostname))729 self.log("debug","Node usync watchdog for host `%s` terminated: confirmed" % (hostname)) 731 730 732 731 def _t_del(self,host,index): … … 737 736 self.log("debug","node: %s" % (node)) 738 737 except: 739 self.log("debug","Node sync watchdog for host `%s` terminated: no such node" % (hostname))738 self.log("debug","Node dsync watchdog for host `%s` terminated: no such node" % (hostname)) 740 739 return 741 740 742 741 if node.dsync.has_key(hostname): 743 742 node.dsync[hostname] -= 1 744 self.log("debug","Node sync request for host `%s`" % (hostname)) 745 746 if node.dsync[hostname] > 0: 747 self.log("debug","Node sync watchdog for host `%s` started with ttl `%s`" % (hostname,node.dsync[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 self.log("debug","Node dsync request for host `%s`" % (hostname)) 744 745 if node.dsync[hostname] >= 0: 746 self.log("debug","Node dsync watchdog for host `%s` started with ttl `%s`" % (hostname,node.dsync[hostname])) 747 Timer(3,self._t_del,(host,index)).start() 750 748 else: 751 self.log("critical","Node sync (del) watchdog: low watermark touch; mark node as stale")749 self.log("critical","Node dsync watchdog: low watermark touch; kick ourself in the ass") 752 750 del node.dsync[hostname] 753 x= ACoreService(self.bus, self.bus.address)754 x.nop()755 return751 y = ACoreService(self.bus, self.bus.address) 752 y.nop() 753 x = ACoreService(self.bus,"%s@%s" %(self.prefix, hostname),flags=CX_MSG_TRACK) 756 754 x._del(index) 757 755 else: 758 self.log("debug","Node sync watchdog for host `%s` terminated: confirmed" % (hostname))756 self.log("debug","Node dsync watchdog for host `%s` terminated: confirmed" % (hostname)) 759 757 760 758 … … 772 770 self.log("debug","hosts list: `%s`" % (x)) 773 771 for i in x: 774 node.dsync[i[0]] = 5 772 if i[1] == "reachable": 773 node.dsync[i[0]] = 5 775 774 self._t_del(i,index) 776 775 … … 817 816 self.log("debug","hosts list: `%s`" % (x)) 818 817 for i in x: 819 node.usync[i[0]] = 5 818 if i[1] == "reachable": 819 node.dsync[i[0]] = 5 820 820 self._t_update(i,p) 821 821 … … 894 894 p.private_data = {} 895 895 for i in x: 896 node.async[i[0]] = 5 896 if i[1] == "reachable": 897 node.async[i[0]] = 5 897 898 self._t_add(i,p) 898 899 #
