Commit e0e5e396 authored by Likun Zhang's avatar Likun Zhang
Browse files

When zone transfer finishing, it will send the same command to zone manager...

When zone transfer finishing, it will send the same command to zone manager and xfrout module, so the zone manager can reset the timer for the next refresh, and xfrout module will notify the zones' slaves.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac289@2619 e5f2f494-b856-4b98-b285-d166d9295462
parent 81c8e9f5
......@@ -51,6 +51,7 @@ SPECFILE_LOCATION = SPECFILE_PATH + "/xfrin.spec"
AUTH_SPECFILE_LOCATION = AUTH_SPECFILE_PATH + "/auth.spec"
XFROUT_MODULE_NAME = 'Xfrout'
ZONE_MANAGER_MODULE_NAME = 'Zonemgr'
__version__ = 'BIND10'
# define xfrin rcode
XFRIN_OK = 0
......@@ -194,7 +195,7 @@ class XfrinConnection(asyncore.dispatcher):
self._handle_xfrin_response)
self.log_msg(logstr + 'succeeded')
self._server.send_notify_command(self._zone_name)
self._server.publish_xfr_finish_news(self._zone_name)
ret = XFRIN_OK
except XfrinException as e:
......@@ -449,11 +450,13 @@ a separate method for the convenience of unit tests.
return answer
def send_notify_command(self, zone_name):
'''Send Notify command to xfrout module.'''
def publish_xfr_finish_news(self, zone_name):
'''Send command to xfrout/zone manager module, that
xfr has finished for one zone, new zone data is ready.'''
param = {'zone_name': zone_name}
msg = create_command(notify_out.ZONE_NOTIFY_CMD, param)
msg = create_command(notify_out.ZONE_NEW_DATA_READY_CMD, param)
self._send_cc_session.group_sendmsg(msg, XFROUT_MODULE_NAME)
self._send_cc_session.group_sendmsg(msg, ZONE_MANAGER_MODULE_NAME)
def _parse_cmd_params(self, args):
zone_name = args.get('zone_name')
......
......@@ -11,7 +11,7 @@ except ImportError as e:
# C++ loadable module may not be installed;
sys.stderr.write('[b10-xfrout] failed to import DNS or XFR module: %s\n' % str(e))
ZONE_NOTIFY_CMD = 'zone_new_data_ready'
ZONE_NEW_DATA_READY_CMD = 'zone_new_data_ready'
_MAX_NOTIFY_NUM = 30
_MAX_NOTIFY_TRY_NUM = 5
_EVENT_NONE = 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment