BIND 10 #386: Thread error in notify out

BIND 10 Development do-not-reply at isc.org
Tue Nov 16 02:49:04 UTC 2010


#386: Thread error in notify out
-------------------------+--------------------------------------------------
      Reporter:  shane   |        Owner:  zzchen_pku
          Type:  defect  |       Status:  accepted  
      Priority:  major   |    Milestone:            
     Component:  xfrout  |   Resolution:            
      Keywords:          |    Sensitive:  0         
Estimatedhours:  0.0     |        Hours:  0         
      Billable:  1       |   Totalhours:  0         
      Internal:  0       |  
-------------------------+--------------------------------------------------

Comment(by zzchen_pku):

 After I looked into the code, I found:
 {{{
  def send_notify(self, zone_name, zone_class='IN'):
  ...
      with self._lock:
          if (self.notify_num >= _MAX_NOTIFY_NUM) or (zone_id in
 self._notifying_zones):
              if zone_id not in self._waiting_zones:
                  self._waiting_zones.append(zone_id)
          else:
              self._notify_infos[zone_id].prepare_notify_out()
              self.notify_num += 1
              self._notifying_zones.append(zone_id)
   ...
 }}}
 If
   * notify_num is bigger or equal than _MAX_NOTIFY_NUM
   * zone_id is already in _notifying_zones list
 the zone_id will be inserted into the _waiting_zones list
 {{{
 def _notify_next_target(self, zone_notify_info):
     ...
     zone_notify_info.notify_try_num = 0
     zone_notify_info.set_next_notify_target()
     tgt = zone_notify_info.get_current_notify_target()
     if not tgt:
         zone_notify_info.finish_notify_out()
         with self._lock:
             self.notify_num -= 1
             self._notifying_zones.remove((zone_notify_info.zone_name,
                                           zone_notify_info.zone_class))
             # trigger notify out for waiting zones
             if len(self._waiting_zones) > 0:
                 zone_id = self._waiting_zones.pop(0)
                 self._notify_infos[zone_id].prepare_notify_out()
                 self.notify_num += 1
    ...
 }}}
 when a waiting zone is scheduled to run,it won't be insert into
 _notifying_zones list any more. At the end, we fail to remove it from
 _notifying_zones list,the exception occurs.
 This is so trival, so I just attached a patch.

-- 
Ticket URL: <http://bind10.isc.org/ticket/386#comment:4>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list