)]}'
{"neutron/db/agentschedulers_db.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a1809b6c01d412623f5104a04775da7ebb170bfa","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            LOG.exception(_LE(\"Exception encountered during %(resource_name)s \""},{"line_number":215,"context_line":"                              \"rescheduling.\"),"},{"line_number":216,"context_line":"                          {\u0027resource_name\u0027: resource_name})"},{"line_number":217,"context_line":"        except Exception:"},{"line_number":218,"context_line":"            # we want to be thorough and catch whatever is raised"},{"line_number":219,"context_line":"            # to avoid loop abortion"},{"line_number":220,"context_line":"            LOG.exception(_LE(\"Exception encountered during %(resource_name)s \""},{"line_number":221,"context_line":"                              \"rescheduling.\"),"},{"line_number":222,"context_line":"                          {\u0027resource_name\u0027: resource_name})"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"class DhcpAgentSchedulerDbMixin(dhcpagentscheduler"}],"source_content_type":"text/x-python","patch_set":4,"id":"9abb7d3a_da10e75b","line":222,"range":{"start_line":217,"start_character":8,"end_line":222,"end_character":59},"updated":"2016-05-31 13:57:48.000000000","message":"ops","commit_id":"5bb1d73831fa3865ba387dc43bd00f2531591264"},{"author":{"_account_id":6579,"name":"Nir Magnezi","email":"nmagnezi@redhat.com","username":"nmagnezi"},"change_message_id":"821d6122f22c379921d96e2eea1af1c960a7616e","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            LOG.exception(_LE(\"Exception encountered during %(resource_name)s \""},{"line_number":215,"context_line":"                              \"rescheduling.\"),"},{"line_number":216,"context_line":"                          {\u0027resource_name\u0027: resource_name})"},{"line_number":217,"context_line":"        except Exception:"},{"line_number":218,"context_line":"            # we want to be thorough and catch whatever is raised"},{"line_number":219,"context_line":"            # to avoid loop abortion"},{"line_number":220,"context_line":"            LOG.exception(_LE(\"Exception encountered during %(resource_name)s \""},{"line_number":221,"context_line":"                              \"rescheduling.\"),"},{"line_number":222,"context_line":"                          {\u0027resource_name\u0027: resource_name})"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"class DhcpAgentSchedulerDbMixin(dhcpagentscheduler"}],"source_content_type":"text/x-python","patch_set":4,"id":"9abb7d3a_e5255009","line":222,"range":{"start_line":217,"start_character":8,"end_line":222,"end_character":59},"in_reply_to":"9abb7d3a_da10e75b","updated":"2016-05-31 14:05:20.000000000","message":"sorry about that. fixed.","commit_id":"5bb1d73831fa3865ba387dc43bd00f2531591264"}],"neutron/db/l3_agentschedulers_db.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ae5a15284ecfa009da64e7fb5383b807f298dd0","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def reschedule_routers_from_down_agents(self):"},{"line_number":95,"context_line":"        \"\"\"Reschedule routers from down l3 agents if admin state is up.\"\"\""},{"line_number":96,"context_line":"        self.reschedule_objects_from_down_agents("},{"line_number":97,"context_line":"                agent_type\u003d\u0027L3\u0027,"},{"line_number":98,"context_line":"                get_down_bindings\u003dself.get_down_router_bindings,"},{"line_number":99,"context_line":"                agent_id_attr\u003d\u0027l3_agent_id\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_1fbbc6e6","line":96,"range":{"start_line":96,"start_character":24,"end_line":96,"end_character":31},"updated":"2016-05-30 08:58:17.000000000","message":"nit: consider \u0027resource\u0027 instead of \u0027object\u0027","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"},{"author":{"_account_id":6579,"name":"Nir Magnezi","email":"nmagnezi@redhat.com","username":"nmagnezi"},"change_message_id":"d85097477aa991713ed99721d2d4c40459eb8fd1","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def reschedule_routers_from_down_agents(self):"},{"line_number":95,"context_line":"        \"\"\"Reschedule routers from down l3 agents if admin state is up.\"\"\""},{"line_number":96,"context_line":"        self.reschedule_objects_from_down_agents("},{"line_number":97,"context_line":"                agent_type\u003d\u0027L3\u0027,"},{"line_number":98,"context_line":"                get_down_bindings\u003dself.get_down_router_bindings,"},{"line_number":99,"context_line":"                agent_id_attr\u003d\u0027l3_agent_id\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_7912b70a","line":96,"range":{"start_line":96,"start_character":24,"end_line":96,"end_character":31},"in_reply_to":"9abb7d3a_1fbbc6e6","updated":"2016-05-31 11:16:59.000000000","message":"Done","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"},{"author":{"_account_id":20257,"name":"liujie","email":"liu.jie3@zte.com.cn","username":"liujie"},"change_message_id":"8c73b49eae05e3855e18bc2d39b1bf613b941ad2","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_down_router_bindings(self, context, agent_dead_limit):"},{"line_number":106,"context_line":"            cutoff \u003d self.get_cutoff_time(agent_dead_limit)"},{"line_number":107,"context_line":"            return (context.session.query(RouterL3AgentBinding)."},{"line_number":108,"context_line":"                    join(agents_db.Agent)."},{"line_number":109,"context_line":"                    filter(agents_db.Agent.heartbeat_timestamp \u003c cutoff,"},{"line_number":110,"context_line":"                    agents_db.Agent.admin_state_up)."}],"source_content_type":"text/x-python","patch_set":1,"id":"bab6814e_bcdebc0e","line":107,"updated":"2016-05-26 09:21:46.000000000","message":"suggest refactoring at here， there are too much  functions in this line。","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"},{"author":{"_account_id":6579,"name":"Nir Magnezi","email":"nmagnezi@redhat.com","username":"nmagnezi"},"change_message_id":"c3075e7f8f258534ae88f79670cdd7b9c697821a","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_down_router_bindings(self, context, agent_dead_limit):"},{"line_number":106,"context_line":"            cutoff \u003d self.get_cutoff_time(agent_dead_limit)"},{"line_number":107,"context_line":"            return (context.session.query(RouterL3AgentBinding)."},{"line_number":108,"context_line":"                    join(agents_db.Agent)."},{"line_number":109,"context_line":"                    filter(agents_db.Agent.heartbeat_timestamp \u003c cutoff,"},{"line_number":110,"context_line":"                    agents_db.Agent.admin_state_up)."}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_1c75a6f8","line":107,"in_reply_to":"bab6814e_bcdebc0e","updated":"2016-05-29 08:21:05.000000000","message":"Care to elaborate? your intention is not clear.\nThis SQL query exists in this form in master today, how would you improve this?\n\nIMO, the indentation makes it readable.","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"71ba0fb9188b97e89944153b687a39319601e3df","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":116,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def reschedule_objects_from_down_agents(self, agent_type,"},{"line_number":119,"context_line":"                                            get_down_bindings,"},{"line_number":120,"context_line":"                                            agent_id_attr,"},{"line_number":121,"context_line":"                                            object_id_attr,"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_1866ad29","line":118,"updated":"2016-05-11 15:45:43.000000000","message":"We should probably have the DHCP rescheduling use this as well.","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ae5a15284ecfa009da64e7fb5383b807f298dd0","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":116,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def reschedule_objects_from_down_agents(self, agent_type,"},{"line_number":119,"context_line":"                                            get_down_bindings,"},{"line_number":120,"context_line":"                                            agent_id_attr,"},{"line_number":121,"context_line":"                                            object_id_attr,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_e44abbc4","line":118,"range":{"start_line":118,"start_character":8,"end_line":118,"end_character":43},"updated":"2016-05-30 08:58:17.000000000","message":"better move to AgentSchedulerDbMixin","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"},{"author":{"_account_id":6579,"name":"Nir Magnezi","email":"nmagnezi@redhat.com","username":"nmagnezi"},"change_message_id":"d85097477aa991713ed99721d2d4c40459eb8fd1","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":116,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def reschedule_objects_from_down_agents(self, agent_type,"},{"line_number":119,"context_line":"                                            get_down_bindings,"},{"line_number":120,"context_line":"                                            agent_id_attr,"},{"line_number":121,"context_line":"                                            object_id_attr,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_d4156a40","line":118,"range":{"start_line":118,"start_character":8,"end_line":118,"end_character":43},"in_reply_to":"9abb7d3a_e44abbc4","updated":"2016-05-31 11:16:59.000000000","message":"Done","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"05c9a144653e5c5f92e6b52706a18983eaf85eb0","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":116,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def reschedule_objects_from_down_agents(self, agent_type,"},{"line_number":119,"context_line":"                                            get_down_bindings,"},{"line_number":120,"context_line":"                                            agent_id_attr,"},{"line_number":121,"context_line":"                                            object_id_attr,"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_1b9ea7b8","line":118,"in_reply_to":"dab17558_1866ad29","updated":"2016-05-11 15:48:15.000000000","message":"... If it makes sense. Nir can you please look in to it? The question is how much code is shared.","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"},{"author":{"_account_id":6579,"name":"Nir Magnezi","email":"nmagnezi@redhat.com","username":"nmagnezi"},"change_message_id":"55f521af50270b761830245a1cfe9158a49f4a65","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":116,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def reschedule_objects_from_down_agents(self, agent_type,"},{"line_number":119,"context_line":"                                            get_down_bindings,"},{"line_number":120,"context_line":"                                            agent_id_attr,"},{"line_number":121,"context_line":"                                            object_id_attr,"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_7b87f3b4","line":118,"in_reply_to":"dab17558_1b9ea7b8","updated":"2016-05-11 16:01:29.000000000","message":"At a first gimps, remove_networks_from_down_agents() looks a lot like that logic, but there are some diffs.\nI will take a closer look and post an update about this.","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"},{"author":{"_account_id":6579,"name":"Nir Magnezi","email":"nmagnezi@redhat.com","username":"nmagnezi"},"change_message_id":"68514e88894e6d791f489e90d63d39b2211438d2","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":116,"context_line":"                        l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def reschedule_objects_from_down_agents(self, agent_type,"},{"line_number":119,"context_line":"                                            get_down_bindings,"},{"line_number":120,"context_line":"                                            agent_id_attr,"},{"line_number":121,"context_line":"                                            object_id_attr,"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_30120fb5","line":118,"in_reply_to":"dab17558_1b9ea7b8","updated":"2016-05-15 09:53:15.000000000","message":"TL;DR: After looking more closely at remove_networks_from_down_agents(), the logic seems similar but not exactly the same.\nI\u0027m not sure if we can merge it due to those differences.\n\nOn the one hand, [1]reschedule_routers_from_down_agents(), which in short is:\n1. Remove routers from dead L3 agents.\n2. schedule those routers again to live agents.\n\nThe entire logic is used only[2] if the configurable value allow_automatic_l3agent_failover \u003d True.\n\n\nOn the other hand, [3]remove_networks_from_down_agents() works as follows:\n1. Remove networks from dead DHCP agents.\n2. Reschedule them *only* if configured so.\n\nHere, for the a similar logic as above we depend on two configurable values, rather than one:\n1. allow_automatic_dhcp_failover[4], much like allow_automatic_l3agent_failover, will determine if we even use the entire logic.\n2. network_auto_schedule[5], for the rescheduling part.\n\n\nThere are other few diffs, (such as the usage of notifiers in remove_networks_from_down_agents), but the above mentioned one is the one I cannot eisaly workaround since it involves existing config values.\n\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/db/l3_agentschedulers_db.py#L90\n[2] https://github.com/openstack/neutron/blob/master/neutron/db/l3_agentschedulers_db.py#L82\n[3] https://github.com/openstack/neutron/blob/master/neutron/db/agentschedulers_db.py#L261\n[4] https://github.com/openstack/neutron/blob/master/neutron/db/agentschedulers_db.py#L170\n[5] https://github.com/openstack/neutron/blob/master/neutron/db/agentschedulers_db.py#L321","commit_id":"9a90e161aa0a7a075433c9eedb29a5505fabf29b"}]}
