From: Michal 'vorner' Vaner Date: Mon, 18 Feb 2013 08:54:40 +0000 (+0100) Subject: [2676] Note why XfrIn is not converted X-Git-Tag: bind10-1.1.0beta1-release~83^2~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd2d3c39ebcba3fb50822fba492c41c6a4bfce25;p=thirdparty%2Fkea.git [2676] Note why XfrIn is not converted There's a hack in XfrIn that prevents straight-forward conversion. Adding the want_answer parameter for now as a temporary measure, until the thing is fixed. --- diff --git a/src/bin/xfrin/tests/xfrin_test.py b/src/bin/xfrin/tests/xfrin_test.py index a1714de2ab..272124b3d4 100644 --- a/src/bin/xfrin/tests/xfrin_test.py +++ b/src/bin/xfrin/tests/xfrin_test.py @@ -2909,7 +2909,7 @@ class TestXfrinProcessMockCCSession: self.recv_called = False self.recv_called_correctly = False - def group_sendmsg(self, msg, module): + def group_sendmsg(self, msg, module, want_answer=False): self.send_called = True if module == 'Auth' and msg['command'][0] == 'loadzone': self.send_called_correctly = True diff --git a/src/bin/xfrin/xfrin.py.in b/src/bin/xfrin/xfrin.py.in index 55d9818f8c..ac479b434b 100755 --- a/src/bin/xfrin/xfrin.py.in +++ b/src/bin/xfrin/xfrin.py.in @@ -1324,7 +1324,8 @@ def _do_auth_loadzone(server, zone_name, zone_class): param = msg['command'][1] logger.debug(DBG_XFRIN_TRACE, XFRIN_AUTH_LOADZONE, param["origin"], param["class"]) - seq = server._send_cc_session.group_sendmsg(msg, AUTH_MODULE_NAME) + seq = server._send_cc_session.group_sendmsg(msg, AUTH_MODULE_NAME, + want_answer=True) answer, env = server._send_cc_session.group_recvmsg(False, seq) class Xfrin: @@ -1630,18 +1631,29 @@ class Xfrin: param = {'zone_name': zone_name.to_text(), 'zone_class': zone_class.to_text()} if xfr_result == XFRIN_OK: + # FIXME: Due to the hack with two different CC sessions + # (see the _cc_setup comment) and the fact the rpc_call + # is a high-level call present only at ModuleCCSession, + # we are forced to use the primitive way of manually + # calling group_sendmsg and the group_recvmsg. Also, why + # do we do group_recvmsg when we don't need the answer? + # And why is this direct RPC call if a notification would + # be more appropriate? _do_auth_loadzone(self, zone_name, zone_class) msg = create_command(notify_out.ZONE_NEW_DATA_READY_CMD, param) # catch the exception, in case msgq has been killed. try: seq = self._send_cc_session.group_sendmsg(msg, - XFROUT_MODULE_NAME) + XFROUT_MODULE_NAME, + want_answer=True) try: answer, env = self._send_cc_session.group_recvmsg(False, seq) except isc.cc.session.SessionTimeout: pass # for now we just ignore the failure - seq = self._send_cc_session.group_sendmsg(msg, ZONE_MANAGER_MODULE_NAME) + seq = self._send_cc_session.group_sendmsg(msg, + ZONE_MANAGER_MODULE_NAME, + want_answer=True) try: answer, env = self._send_cc_session.group_recvmsg(False, seq) @@ -1654,7 +1666,8 @@ class Xfrin: msg = create_command(notify_out.ZONE_XFRIN_FAILED, param) # catch the exception, in case msgq has been killed. try: - seq = self._send_cc_session.group_sendmsg(msg, ZONE_MANAGER_MODULE_NAME) + seq = self._send_cc_session.group_sendmsg(msg, ZONE_MANAGER_MODULE_NAME, + want_answer=True) try: answer, env = self._send_cc_session.group_recvmsg(False, seq)