)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"1cdddcfabf226ddd7542ed44c4a75921f609059d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Network rescheduling would be triggered when neutron server is"},{"line_number":10,"context_line":"discovering that agents are down. At the same time, some bare metal and"},{"line_number":11,"context_line":"node management systems will reboot those same nodes at the same time."},{"line_number":12,"context_line":"When those two actions happen together, it will result in the server"},{"line_number":13,"context_line":"sending RPC notifications to agents that just get rebooted which will"},{"line_number":14,"context_line":"lead to stale RPC messages when the DHCP agents return to service. These"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"3f79a3b5_3334dfab","line":11,"range":{"start_line":11,"start_character":53,"end_line":11,"end_character":69},"updated":"2018-10-26 08:18:52.000000000","message":"nitty nit (change only if You will respin this patch): this is not needed","commit_id":"6e702d79c407ae34eca0939adfb41dcd83dea4ea"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"31220edf29617ad35d4e46fa2b26c7903c8e4c66","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Network rescheduling would be triggered when neutron server is"},{"line_number":10,"context_line":"discovering that agents are down. At the same time, some bare metal and"},{"line_number":11,"context_line":"node management systems will reboot those same nodes at the same time."},{"line_number":12,"context_line":"When those two actions happen together, it will result in the server"},{"line_number":13,"context_line":"sending RPC notifications to agents that just get rebooted which will"},{"line_number":14,"context_line":"lead to stale RPC messages when the DHCP agents return to service. These"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"3f79a3b5_73a5779f","line":11,"range":{"start_line":11,"start_character":53,"end_line":11,"end_character":69},"in_reply_to":"3f79a3b5_3334dfab","updated":"2018-10-26 08:58:02.000000000","message":"Done","commit_id":"6e702d79c407ae34eca0939adfb41dcd83dea4ea"}],"neutron/agent/dhcp/agent.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"c47181409d9a92188c37e449581885000d50fa92","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def decorator(f):"},{"line_number":79,"context_line":"        @functools.wraps(f)"},{"line_number":80,"context_line":"        def inner(self, *args, **kwargs):"},{"line_number":81,"context_line":"            if getattr(self, \u0027enable_rpc\u0027, True):"},{"line_number":82,"context_line":"                f(self, *args, **kwargs)"},{"line_number":83,"context_line":"            else:"},{"line_number":84,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":85,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":86,"context_line":"        return inner"},{"line_number":87,"context_line":"    return decorator"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_44f55ecb","line":85,"range":{"start_line":81,"start_character":0,"end_line":85,"end_character":65},"updated":"2018-10-10 21:15:41.000000000","message":"I have an alternate idea for this. Instead of relying on the \u0027enable_rpc\u0027 attribute to determinate whether to invoke the function \u0027f\u0027, would it be possible to simply compute the time delta between now and agent\u0027s start_time. If the delta is larger than \u0027initial_delay\u0027 we process the RPC message. The pseudocode would be:\n\n            if now - self.started_at \u003e self.conf.initial_delay:\n                f(self, *args, **kwargs)\n            else:\n                LOG.warning(\"{} RPC method ignored before initial state \"\n                            \"synchronization\".format(f.__name__))","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"04d0a3a24e1ad7339e0188f26126011cb815f766","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def decorator(f):"},{"line_number":79,"context_line":"        @functools.wraps(f)"},{"line_number":80,"context_line":"        def inner(self, *args, **kwargs):"},{"line_number":81,"context_line":"            if getattr(self, \u0027enable_rpc\u0027, True):"},{"line_number":82,"context_line":"                f(self, *args, **kwargs)"},{"line_number":83,"context_line":"            else:"},{"line_number":84,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":85,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":86,"context_line":"        return inner"},{"line_number":87,"context_line":"    return decorator"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_8aec7b28","line":85,"range":{"start_line":81,"start_character":0,"end_line":85,"end_character":65},"in_reply_to":"3f79a3b5_44f55ecb","updated":"2018-10-16 09:37:06.000000000","message":"Hongbin, thanks a lot for the suggestion.\nIt seems to me that the flag-based solution might be better.\nUsing timestamp, we may not be able to guarantee that the RPC messages are processed strictly after the state sync has completed. BTW, using flag is also a simple way IMO.\nLet\u0027s leave the solution open for now. Would you please kindly clarify the benefit of the proposed timestamp-based solution?","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"6c172f6f8e5ba64cc1380e29e019ca3bb704e3ea","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def decorator(f):"},{"line_number":79,"context_line":"        @functools.wraps(f)"},{"line_number":80,"context_line":"        def inner(self, *args, **kwargs):"},{"line_number":81,"context_line":"            if getattr(self, \u0027enable_rpc\u0027, True):"},{"line_number":82,"context_line":"                f(self, *args, **kwargs)"},{"line_number":83,"context_line":"            else:"},{"line_number":84,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":85,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":86,"context_line":"        return inner"},{"line_number":87,"context_line":"    return decorator"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_d1bd38d1","line":85,"range":{"start_line":81,"start_character":0,"end_line":85,"end_character":65},"in_reply_to":"3f79a3b5_8aec7b28","updated":"2018-10-16 18:35:54.000000000","message":"My concern on the flag-based approach is the risk of unintentional disabling of RPC. For example, right now, we rely on some condition to reset enable_rpc to True, but if the condition is unsatisfied (i.e. due to bug or unintentional changes), the rpc will be disabled permanently. The timestamp-based approach could mitigate this issue.\n\nHowever, I don\u0027t have strong opinion on that. It is your call.","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"a93d8e5d4b1caed995dd89fec40a57ea1954cdcf","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def decorator(f):"},{"line_number":79,"context_line":"        @functools.wraps(f)"},{"line_number":80,"context_line":"        def inner(self, *args, **kwargs):"},{"line_number":81,"context_line":"            if getattr(self, \u0027enable_rpc\u0027, True):"},{"line_number":82,"context_line":"                f(self, *args, **kwargs)"},{"line_number":83,"context_line":"            else:"},{"line_number":84,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":85,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":86,"context_line":"        return inner"},{"line_number":87,"context_line":"    return decorator"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_2e1e825d","line":85,"range":{"start_line":81,"start_character":0,"end_line":85,"end_character":65},"in_reply_to":"3f79a3b5_d1bd38d1","updated":"2018-10-17 02:48:19.000000000","message":"The concern makes sense to me in a way. Otherwise implementing a timeout (let\u0027s say twice the initial_delay) together w/ the flag-based approach might be a choice.\nLet\u0027s have this open. I\u0027m willing to adjust the implementation based on the feedbacks.","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"b66f7bbe0e7aaccc4dcb04ed9704f56cf68ae4b1","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def init_host(self):"},{"line_number":122,"context_line":"        if self.conf.initial_delay \u003e 0:"},{"line_number":123,"context_line":"            # Do not run sync_state until report_state is called after the"},{"line_number":124,"context_line":"            # delay."},{"line_number":125,"context_line":"            return"},{"line_number":126,"context_line":"        self.sync_state()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_c8fe6669","line":123,"range":{"start_line":123,"start_character":42,"end_line":123,"end_character":54},"updated":"2018-10-10 19:26:09.000000000","message":"Are you sure all the subclass of DhcpAgent support report_state?","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"04d0a3a24e1ad7339e0188f26126011cb815f766","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def init_host(self):"},{"line_number":122,"context_line":"        if self.conf.initial_delay \u003e 0:"},{"line_number":123,"context_line":"            # Do not run sync_state until report_state is called after the"},{"line_number":124,"context_line":"            # delay."},{"line_number":125,"context_line":"            return"},{"line_number":126,"context_line":"        self.sync_state()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_e15ed177","line":123,"range":{"start_line":123,"start_character":42,"end_line":123,"end_character":54},"in_reply_to":"3f79a3b5_c8fe6669","updated":"2018-10-16 09:37:06.000000000","message":"Not all subclass of DhcpAgent should support report_state. We should cover all the possible cases. The notes should be updated.","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"b66f7bbe0e7aaccc4dcb04ed9704f56cf68ae4b1","unresolved":false,"context_lines":[{"line_number":767,"context_line":"class DhcpAgentWithStateReport(DhcpAgent):"},{"line_number":768,"context_line":"    def __init__(self, host\u003dNone, conf\u003dNone):"},{"line_number":769,"context_line":"        super(DhcpAgentWithStateReport, self).__init__(host\u003dhost, conf\u003dconf)"},{"line_number":770,"context_line":"        if self.conf.initial_delay \u003e 0:"},{"line_number":771,"context_line":"            # Do not allow DHCP agent to process any RPC method when agent"},{"line_number":772,"context_line":"            # initialization."},{"line_number":773,"context_line":"            self.enable_rpc \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_28ecbaf2","line":770,"range":{"start_line":770,"start_character":8,"end_line":770,"end_character":10},"updated":"2018-10-10 19:26:09.000000000","message":"Should we check self.conf.report_interval as well?","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"04d0a3a24e1ad7339e0188f26126011cb815f766","unresolved":false,"context_lines":[{"line_number":767,"context_line":"class DhcpAgentWithStateReport(DhcpAgent):"},{"line_number":768,"context_line":"    def __init__(self, host\u003dNone, conf\u003dNone):"},{"line_number":769,"context_line":"        super(DhcpAgentWithStateReport, self).__init__(host\u003dhost, conf\u003dconf)"},{"line_number":770,"context_line":"        if self.conf.initial_delay \u003e 0:"},{"line_number":771,"context_line":"            # Do not allow DHCP agent to process any RPC method when agent"},{"line_number":772,"context_line":"            # initialization."},{"line_number":773,"context_line":"            self.enable_rpc \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_e562003d","line":770,"range":{"start_line":770,"start_character":8,"end_line":770,"end_character":10},"in_reply_to":"3f79a3b5_28ecbaf2","updated":"2018-10-16 09:37:06.000000000","message":"I was trying to cover all cases:\n1) no report + no delay;\n2) no report + delay;\n3) report + no delay;\n4) report + delay\nin different places.\nHere, the logic is that we don\u0027t need a enable_rpc field if no delay is configured.","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"7368e946e5271a888e9d8b0af4143c24e89c8437","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        if self.conf.initial_delay \u003e 0:"},{"line_number":150,"context_line":"            # Proactively sync the local DHCP state with Neutron about all the"},{"line_number":151,"context_line":"            # networks when activating the DHCP agent."},{"line_number":152,"context_line":"            self.sync_state()"},{"line_number":153,"context_line":"            self.enable_rpc \u003d True"},{"line_number":154,"context_line":"        self.periodic_resync()"},{"line_number":155,"context_line":"        self.start_ready_ports_loop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_97601f0f","line":152,"updated":"2018-10-16 10:15:35.000000000","message":"Do we need to do this every time we execute run()?\n\nThis is not executed during the starting process. I mean, this change goes beyond the bug description (I\u0027m not saying this is wrong).\n\nBe aware this will require many RPC calls between the agent and the server.","commit_id":"9989b97b7882595d5906892a3924409edbcc7830"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"a93d8e5d4b1caed995dd89fec40a57ea1954cdcf","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        if self.conf.initial_delay \u003e 0:"},{"line_number":150,"context_line":"            # Proactively sync the local DHCP state with Neutron about all the"},{"line_number":151,"context_line":"            # networks when activating the DHCP agent."},{"line_number":152,"context_line":"            self.sync_state()"},{"line_number":153,"context_line":"            self.enable_rpc \u003d True"},{"line_number":154,"context_line":"        self.periodic_resync()"},{"line_number":155,"context_line":"        self.start_ready_ports_loop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_f36e31fc","line":152,"in_reply_to":"3f79a3b5_97601f0f","updated":"2018-10-17 02:48:19.000000000","message":"Thanks for the comment.\nIt looks like that run is executed only when report_state is not supported or during the starting process [1][2][3]. Just correct me if I\u0027m wrong.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/agent/dhcp/agent.py#L124\n[2] https://github.com/openstack/neutron/blob/master/neutron/agent/dhcp/agent.py#L772\n[3] https://github.com/openstack/neutron/blob/master/neutron/agent/dhcp/agent.py#L778","commit_id":"9989b97b7882595d5906892a3924409edbcc7830"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"acb316a47bca1872395c44e0316a09ee856a4abf","unresolved":false,"context_lines":[{"line_number":791,"context_line":"            # reporting/synchronization and new RPC message processing, if it"},{"line_number":792,"context_line":"            # has value configured."},{"line_number":793,"context_line":"            self.heartbeat.start(interval\u003dreport_interval,"},{"line_number":794,"context_line":"                                 initial_delay\u003dself.conf.initial_delay)"},{"line_number":795,"context_line":"        elif not report_interval and self.conf.initial_delay \u003e 0:"},{"line_number":796,"context_line":"            eventlet.sleep(self.conf.initial_delay)"},{"line_number":797,"context_line":"            self.sync_state()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_fd559b20","line":794,"updated":"2018-10-17 08:11:35.000000000","message":"How this will work in case when DHCP agent will just be restarted? If this initial_delay will be set to some quite high number (which should be the case for agent where we have a lot networks configured and initial sync may take long time) it will here wait this quite long time before sending heartbeat, right?\nIf so, it may cause that neutron-server will treat this agent as DOWN for some time. This may trigger removing of all networks from this DHCP agent.\nIf I\u0027m right I don\u0027t think that this is good idea to add such delay here. Some time ago we moved heartbeat to separate workers to avoid such issues like agent flapping during the full sync and here You propose something which may do the same again.","commit_id":"9989b97b7882595d5906892a3924409edbcc7830"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"c6d650acf1ce6a654b4398f4868267caa80a9073","unresolved":false,"context_lines":[{"line_number":791,"context_line":"            # reporting/synchronization and new RPC message processing, if it"},{"line_number":792,"context_line":"            # has value configured."},{"line_number":793,"context_line":"            self.heartbeat.start(interval\u003dreport_interval,"},{"line_number":794,"context_line":"                                 initial_delay\u003dself.conf.initial_delay)"},{"line_number":795,"context_line":"        elif not report_interval and self.conf.initial_delay \u003e 0:"},{"line_number":796,"context_line":"            eventlet.sleep(self.conf.initial_delay)"},{"line_number":797,"context_line":"            self.sync_state()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_11607bd0","line":794,"in_reply_to":"3f79a3b5_fd559b20","updated":"2018-10-17 13:39:53.000000000","message":"Move the delay to run() to try not blocking heartbeat.","commit_id":"9989b97b7882595d5906892a3924409edbcc7830"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4673992fadd00ae8257b6641adbf19437a207550","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def decorator(f):"},{"line_number":79,"context_line":"        @functools.wraps(f)"},{"line_number":80,"context_line":"        def inner(self, *args, **kwargs):"},{"line_number":81,"context_line":"            if getattr(self, \u0027_rpc_enabled\u0027, True):"},{"line_number":82,"context_line":"                f(self, *args, **kwargs)"},{"line_number":83,"context_line":"            else:"},{"line_number":84,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":85,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":86,"context_line":"        return inner"},{"line_number":87,"context_line":"    return decorator"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_79fe0a3a","line":85,"range":{"start_line":81,"start_character":0,"end_line":85,"end_character":65},"updated":"2018-10-23 10:35:20.000000000","message":"Here will be:\n\n            if getattr(self, \u0027_block_rpc\u0027, False):\n                LOG.warning(\"{} RPC method ignored before initial state \"\n                            \"synchronization\".format(f.__name__))\n            else:\n                f(self, *args, **kwargs)","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"f8b7ab27d36fe747dda5a2620bc4d1460e5b0178","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def decorator(f):"},{"line_number":79,"context_line":"        @functools.wraps(f)"},{"line_number":80,"context_line":"        def inner(self, *args, **kwargs):"},{"line_number":81,"context_line":"            if getattr(self, \u0027_rpc_enabled\u0027, True):"},{"line_number":82,"context_line":"                f(self, *args, **kwargs)"},{"line_number":83,"context_line":"            else:"},{"line_number":84,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":85,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":86,"context_line":"        return inner"},{"line_number":87,"context_line":"    return decorator"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_daa7faba","line":85,"range":{"start_line":81,"start_character":0,"end_line":85,"end_character":65},"in_reply_to":"3f79a3b5_79fe0a3a","updated":"2018-10-24 02:56:17.000000000","message":"Done","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4673992fadd00ae8257b6641adbf19437a207550","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        self._process_monitor \u003d external_process.ProcessMonitor("},{"line_number":118,"context_line":"            config\u003dself.conf,"},{"line_number":119,"context_line":"            resource_type\u003d\u0027dhcp\u0027)"},{"line_number":120,"context_line":"        self._rpc_enabled \u003d not self.conf.initial_state_delay \u003e 0"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def init_host(self):"},{"line_number":123,"context_line":"        if not self._rpc_enabled:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_7967ea53","line":120,"range":{"start_line":120,"start_character":28,"end_line":120,"end_character":65},"updated":"2018-10-23 10:35:20.000000000","message":"Can use the `bool(self.conf.initial_state_delay)` instead?\nAnd I have a question, the attribute is _xxx_enabled, why here use a \u0027not\u0027 operator? This will cause come confusion. What about:\n\"\"\"\nself._block_rpc \u003d bool(self.conf.initial_state_delay)\n\"\"\"","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"f8b7ab27d36fe747dda5a2620bc4d1460e5b0178","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        self._process_monitor \u003d external_process.ProcessMonitor("},{"line_number":118,"context_line":"            config\u003dself.conf,"},{"line_number":119,"context_line":"            resource_type\u003d\u0027dhcp\u0027)"},{"line_number":120,"context_line":"        self._rpc_enabled \u003d not self.conf.initial_state_delay \u003e 0"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def init_host(self):"},{"line_number":123,"context_line":"        if not self._rpc_enabled:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_1ac8121f","line":120,"range":{"start_line":120,"start_character":28,"end_line":120,"end_character":65},"in_reply_to":"3f79a3b5_7967ea53","updated":"2018-10-24 02:56:17.000000000","message":"Thanks Yulong for the suggestion. I\u0027m OK with it. Updated.","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4673992fadd00ae8257b6641adbf19437a207550","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        self._rpc_enabled \u003d not self.conf.initial_state_delay \u003e 0"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def init_host(self):"},{"line_number":123,"context_line":"        if not self._rpc_enabled:"},{"line_number":124,"context_line":"            # Do not run sync_state, call it after the delay."},{"line_number":125,"context_line":"            return"},{"line_number":126,"context_line":"        self.sync_state()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_d9ce3e2b","line":123,"range":{"start_line":123,"start_character":8,"end_line":123,"end_character":33},"updated":"2018-10-23 10:35:20.000000000","message":"According to the line 120 suggestion, here will be:\nif self._block_rpc:\n    ...","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"f8b7ab27d36fe747dda5a2620bc4d1460e5b0178","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        self._rpc_enabled \u003d not self.conf.initial_state_delay \u003e 0"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def init_host(self):"},{"line_number":123,"context_line":"        if not self._rpc_enabled:"},{"line_number":124,"context_line":"            # Do not run sync_state, call it after the delay."},{"line_number":125,"context_line":"            return"},{"line_number":126,"context_line":"        self.sync_state()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_1af1f26a","line":123,"range":{"start_line":123,"start_character":8,"end_line":123,"end_character":33},"in_reply_to":"3f79a3b5_d9ce3e2b","updated":"2018-10-24 02:56:17.000000000","message":"Done","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4673992fadd00ae8257b6641adbf19437a207550","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        wait that many seconds before doing a state synchronization,"},{"line_number":153,"context_line":"        then enable RPC messages."},{"line_number":154,"context_line":"        \"\"\""},{"line_number":155,"context_line":"        if self._rpc_enabled:"},{"line_number":156,"context_line":"            return"},{"line_number":157,"context_line":"        eventlet.sleep(self.conf.initial_state_delay)"},{"line_number":158,"context_line":"        self.sync_state()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_99d0c6c8","line":155,"range":{"start_line":155,"start_character":8,"end_line":155,"end_character":29},"updated":"2018-10-23 10:35:20.000000000","message":"if not _block_rpc:\n    ...","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"f8b7ab27d36fe747dda5a2620bc4d1460e5b0178","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        wait that many seconds before doing a state synchronization,"},{"line_number":153,"context_line":"        then enable RPC messages."},{"line_number":154,"context_line":"        \"\"\""},{"line_number":155,"context_line":"        if self._rpc_enabled:"},{"line_number":156,"context_line":"            return"},{"line_number":157,"context_line":"        eventlet.sleep(self.conf.initial_state_delay)"},{"line_number":158,"context_line":"        self.sync_state()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_3af5ce52","line":155,"range":{"start_line":155,"start_character":8,"end_line":155,"end_character":29},"in_reply_to":"3f79a3b5_99d0c6c8","updated":"2018-10-24 02:56:17.000000000","message":"Done","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"1cdddcfabf226ddd7542ed44c4a75921f609059d","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":84,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":85,"context_line":"            else:"},{"line_number":86,"context_line":"                f(self, *args, **kwargs)"},{"line_number":87,"context_line":"        return inner"},{"line_number":88,"context_line":"    return decorator"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_936133a5","line":86,"updated":"2018-10-26 08:18:52.000000000","message":"I think that You should return result of \"f\" here","commit_id":"6e702d79c407ae34eca0939adfb41dcd83dea4ea"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"31220edf29617ad35d4e46fa2b26c7903c8e4c66","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":84,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":85,"context_line":"            else:"},{"line_number":86,"context_line":"                f(self, *args, **kwargs)"},{"line_number":87,"context_line":"        return inner"},{"line_number":88,"context_line":"    return decorator"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_16a191f6","line":86,"in_reply_to":"3f79a3b5_936133a5","updated":"2018-10-26 08:58:02.000000000","message":"Functions currently decorated (e.g. network_create_end etc.) all seem to return None. Anyway, I agree it\u0027s better we have a return here.","commit_id":"6e702d79c407ae34eca0939adfb41dcd83dea4ea"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"2a44ccef30c0213b41931122f31d6ca4fd0e762e","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    def decorator(f):"},{"line_number":80,"context_line":"        @functools.wraps(f)"},{"line_number":81,"context_line":"        def inner(self, *args, **kwargs):"},{"line_number":82,"context_line":"            if getattr(self, \u0027_block_rpc\u0027, True):"},{"line_number":83,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":84,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":85,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_3e3edfb5","line":82,"range":{"start_line":82,"start_character":43,"end_line":82,"end_character":47},"updated":"2018-10-26 14:49:27.000000000","message":"The \u0027conf.initial_state_delay\u0027 default value is 0, so the _block_rpc should have a default False here?","commit_id":"8c2d108de0596ea97693a69d924fdb28ad819105"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"fd301142be7cb8c9d515a25bf79e57ec592ad146","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    def decorator(f):"},{"line_number":80,"context_line":"        @functools.wraps(f)"},{"line_number":81,"context_line":"        def inner(self, *args, **kwargs):"},{"line_number":82,"context_line":"            if getattr(self, \u0027_block_rpc\u0027, True):"},{"line_number":83,"context_line":"                LOG.warning(\"{} RPC method ignored before initial state \""},{"line_number":84,"context_line":"                            \"synchronization\".format(f.__name__))"},{"line_number":85,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_2acb64a7","line":82,"range":{"start_line":82,"start_character":43,"end_line":82,"end_character":47},"in_reply_to":"3f79a3b5_3e3edfb5","updated":"2018-11-20 09:11:28.000000000","message":"Done","commit_id":"8c2d108de0596ea97693a69d924fdb28ad819105"}],"neutron/conf/agent/dhcp.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"b66f7bbe0e7aaccc4dcb04ed9704f56cf68ae4b1","unresolved":false,"context_lines":[{"line_number":30,"context_line":"                      \"time before reporting state to the server and starting \""},{"line_number":31,"context_line":"                      \"the state synchronization procedure. This is to allow \""},{"line_number":32,"context_line":"                      \"stale RPC messages to be synced before starting \""},{"line_number":33,"context_line":"                      \"processing new RPC messages.\""},{"line_number":34,"context_line":"                      \"The delay is number of seconds to wait.\")),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027dhcp_driver\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027neutron.agent.linux.dhcp.Dnsmasq\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_e896c2a0","line":33,"range":{"start_line":33,"start_character":50,"end_line":33,"end_character":52},"updated":"2018-10-10 19:26:09.000000000","message":"nit: space in between.","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"04d0a3a24e1ad7339e0188f26126011cb815f766","unresolved":false,"context_lines":[{"line_number":30,"context_line":"                      \"time before reporting state to the server and starting \""},{"line_number":31,"context_line":"                      \"the state synchronization procedure. This is to allow \""},{"line_number":32,"context_line":"                      \"stale RPC messages to be synced before starting \""},{"line_number":33,"context_line":"                      \"processing new RPC messages.\""},{"line_number":34,"context_line":"                      \"The delay is number of seconds to wait.\")),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027dhcp_driver\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027neutron.agent.linux.dhcp.Dnsmasq\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_0bba0ebf","line":33,"range":{"start_line":33,"start_character":50,"end_line":33,"end_character":52},"in_reply_to":"3f79a3b5_e896c2a0","updated":"2018-10-16 09:37:06.000000000","message":"Done","commit_id":"041ae0ed40ce12cfdf506dc152b41ce67fcb88f5"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"acb316a47bca1872395c44e0316a09ee856a4abf","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                      \"the state synchronization procedure. This is to allow \""},{"line_number":32,"context_line":"                      \"stale RPC messages to be synced before starting \""},{"line_number":33,"context_line":"                      \"processing new RPC messages. \""},{"line_number":34,"context_line":"                      \"The delay is number of seconds to wait.\")),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027dhcp_driver\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027neutron.agent.linux.dhcp.Dnsmasq\u0027,"},{"line_number":37,"context_line":"               help\u003d_(\"The driver used to manage the DHCP server.\")),"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_bd2403c5","line":34,"updated":"2018-10-17 08:11:35.000000000","message":"You should add info that if it\u0027s set to 0 it will not have any effect and agent will work like before","commit_id":"9989b97b7882595d5906892a3924409edbcc7830"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"c6d650acf1ce6a654b4398f4868267caa80a9073","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                      \"the state synchronization procedure. This is to allow \""},{"line_number":32,"context_line":"                      \"stale RPC messages to be synced before starting \""},{"line_number":33,"context_line":"                      \"processing new RPC messages. \""},{"line_number":34,"context_line":"                      \"The delay is number of seconds to wait.\")),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027dhcp_driver\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027neutron.agent.linux.dhcp.Dnsmasq\u0027,"},{"line_number":37,"context_line":"               help\u003d_(\"The driver used to manage the DHCP server.\")),"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_2850b309","line":34,"in_reply_to":"3f79a3b5_bd2403c5","updated":"2018-10-17 13:39:53.000000000","message":"Done","commit_id":"9989b97b7882595d5906892a3924409edbcc7830"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4673992fadd00ae8257b6641adbf19437a207550","unresolved":false,"context_lines":[{"line_number":25,"context_line":"               help\u003d_(\"The DHCP agent will resync its state with Neutron to \""},{"line_number":26,"context_line":"                      \"recover from any transient notification or RPC errors. \""},{"line_number":27,"context_line":"                      \"The interval is number of seconds between attempts.\")),"},{"line_number":28,"context_line":"    cfg.IntOpt(\u0027initial_state_delay\u0027, default\u003d0,"},{"line_number":29,"context_line":"               help\u003d_(\"Allows for a delay in the initial state report from \""},{"line_number":30,"context_line":"                      \"the DHCP agent. This will allow stale RPC messages \""},{"line_number":31,"context_line":"                      \"to be processed before newer ones. \""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_79836aab","line":28,"updated":"2018-10-23 10:35:20.000000000","message":"If you are going to refactor the code to bool(initial_state_delay), it\u0027s better to add a min value (min\u003d0) here.","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"f8b7ab27d36fe747dda5a2620bc4d1460e5b0178","unresolved":false,"context_lines":[{"line_number":25,"context_line":"               help\u003d_(\"The DHCP agent will resync its state with Neutron to \""},{"line_number":26,"context_line":"                      \"recover from any transient notification or RPC errors. \""},{"line_number":27,"context_line":"                      \"The interval is number of seconds between attempts.\")),"},{"line_number":28,"context_line":"    cfg.IntOpt(\u0027initial_state_delay\u0027, default\u003d0,"},{"line_number":29,"context_line":"               help\u003d_(\"Allows for a delay in the initial state report from \""},{"line_number":30,"context_line":"                      \"the DHCP agent. This will allow stale RPC messages \""},{"line_number":31,"context_line":"                      \"to be processed before newer ones. \""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_1a96d2f0","line":28,"in_reply_to":"3f79a3b5_79836aab","updated":"2018-10-24 02:56:17.000000000","message":"Done","commit_id":"33f44150a5364dc1ab065023406e103659c1bca5"}],"releasenotes/notes/dhcp-initial-delay-config-option-6021a3dae5d5d6cd.yaml":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"acb316a47bca1872395c44e0316a09ee856a4abf","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - "},{"line_number":4,"context_line":"    A new config option ``initial_delay`` has been introduced."},{"line_number":5,"context_line":"    This new option make the DHCP agent waits for a specified amount of delay"},{"line_number":6,"context_line":"    before reporting state to the Neutron server and starting the sync state"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3f79a3b5_5d2a8f97","line":3,"range":{"start_line":3,"start_character":3,"end_line":3,"end_character":4},"updated":"2018-10-17 08:11:35.000000000","message":"trailing space, please remove it","commit_id":"9989b97b7882595d5906892a3924409edbcc7830"},{"author":{"_account_id":28373,"name":"Kailun Qin","email":"kailun.qin@hotmail.com","username":"kailun.qin"},"change_message_id":"c6d650acf1ce6a654b4398f4868267caa80a9073","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - "},{"line_number":4,"context_line":"    A new config option ``initial_delay`` has been introduced."},{"line_number":5,"context_line":"    This new option make the DHCP agent waits for a specified amount of delay"},{"line_number":6,"context_line":"    before reporting state to the Neutron server and starting the sync state"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3f79a3b5_c82b3f7a","line":3,"range":{"start_line":3,"start_character":3,"end_line":3,"end_character":4},"in_reply_to":"3f79a3b5_5d2a8f97","updated":"2018-10-17 13:39:53.000000000","message":"Done","commit_id":"9989b97b7882595d5906892a3924409edbcc7830"}]}
