Opened 9 years ago

Closed 9 years ago

#386 closed defect (fixed)

Thread error in notify out

Reported by: shane Owned by: zzchen_pku
Priority: medium Milestone:
Component: xfrout Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: 0.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

I got the following error from my BIND 10 instance:

18-Oct-2010 16:24:55.245 Xfrout: INFO: notify to 2001:610:719:1::3#53: retried exceeded
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.1/threading.py", line 516, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.1/threading.py", line 469, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/bind10/lib/python3.1/site-packages/isc/notify/notify_out.py", line 68, in dispatcher
    notifier._zone_notify_handler(not_replied_zones[name_], _EVENT_TIMEOUT)
  File "/opt/bind10/lib/python3.1/site-packages/isc/notify/notify_out.py", line 277, in _zone_notify_handler
    self._notify_next_target(zone_notify_info)
  File "/opt/bind10/lib/python3.1/site-packages/isc/notify/notify_out.py", line 295, in _notify_next_target
    zone_notify_info.zone_class))
ValueError: list.remove(x): x not in list

Assigning to Jerry, although maybe he is not the best. Please re-assign if it should belong to someone else!

Subtickets

Attachments (1)

notifyout.diff (633 bytes) - added by zzchen_pku 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 years ago by shane

Oh, I should also note that this particular BIND 10 instance has no IPv6 enabled, although the zone does include AAAA records, which caused a bunch of failures.

comment:2 Changed 9 years ago by shane

  • Owner changed from zhanglikun to zzchen_pku
  • Status changed from new to assigned

comment:3 Changed 9 years ago by zzchen_pku

  • Status changed from assigned to accepted

Changed 9 years ago by zzchen_pku

comment:4 Changed 9 years ago 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.

comment:5 Changed 9 years ago by zzchen_pku

  • Owner changed from zzchen_pku to UnAssigned
  • Status changed from accepted to reviewing

comment:6 Changed 9 years ago by zzchen_pku

  • Owner changed from UnAssigned to stephen

Stephen, I am not sure if it is proper to assgin this review to you , since you reviewed the notify-out before.

comment:7 Changed 9 years ago by stephen

  • Owner changed from stephen to zzchen_pku

Change reviewed. It seems OK, please go ahead and apply it.

comment:8 Changed 9 years ago by zzchen_pku

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merged into trunk, closing it.

Note: See TracTickets for help on using tickets.