)]}'
{"ironic_inspector/common/coordination.py":[{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"9dca3a2998dda7b2542e4c1df1ec9721c626cb3f","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        lock_name \u003d (self.lock_prefix + uuid).encode(\u0027ascii\u0027)"},{"line_number":146,"context_line":"        return self.coordinator.get_lock(lock_name)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def run_elect_coordinator(self):"},{"line_number":149,"context_line":"        \"\"\"Trigger a new leader election.\"\"\""},{"line_number":150,"context_line":"        LOG.debug(\u0027Starting leader election\u0027)"},{"line_number":151,"context_line":"        self.coordinator.run_elect_coordinator()"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf51134e_244470b7","line":148,"updated":"2020-07-01 08:29:28.000000000","message":"nit: run_elect_leader or just elect_leader ?","commit_id":"c9d20c26f11b054d95e8eeee78ae939c10d9138d"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"9203ae6c5f8a32c3437da279c38ecedfe246633f","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        lock_name \u003d (self.lock_prefix + uuid).encode(\u0027ascii\u0027)"},{"line_number":146,"context_line":"        return self.coordinator.get_lock(lock_name)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def run_elect_coordinator(self):"},{"line_number":149,"context_line":"        \"\"\"Trigger a new leader election.\"\"\""},{"line_number":150,"context_line":"        LOG.debug(\u0027Starting leader election\u0027)"},{"line_number":151,"context_line":"        self.coordinator.run_elect_coordinator()"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf51134e_6466682c","line":148,"in_reply_to":"bf51134e_244470b7","updated":"2020-07-01 08:42:29.000000000","message":"As the other functions echo\u0027ed the member functions of the coordinator class (e.g. \"leave_group\" for \"coordinator.leave_group\"), I did the same here.","commit_id":"c9d20c26f11b054d95e8eeee78ae939c10d9138d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7ccea47cc6fc13a5eee04808e949b4838d1804f5","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            LOG.warning(\u0027The coordination backend does not support leader \u0027"},{"line_number":103,"context_line":"                        \u0027elections, assuming we are a leader. This is \u0027"},{"line_number":104,"context_line":"                        \u0027deprecated, please use a supported backend\u0027)"},{"line_number":105,"context_line":"            self.is_leader \u003d True"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def join_group(self):"},{"line_number":108,"context_line":"        \"\"\"Join service group.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_d1cf1fae","line":105,"updated":"2020-07-02 09:58:20.000000000","message":"nit: as discussion on IRC, ideally we shouldn\u0027t store local state, but check who is the leader every time. This patch is good as a start though.","commit_id":"8c07e056d06d71cffaf258a156361d71ca555d3b"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"74d1ae5f760ba74f3adad512b2d63a6890875e4b","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            LOG.warning(\u0027The coordination backend does not support leader \u0027"},{"line_number":103,"context_line":"                        \u0027elections, assuming we are a leader. This is \u0027"},{"line_number":104,"context_line":"                        \u0027deprecated, please use a supported backend\u0027)"},{"line_number":105,"context_line":"            self.is_leader \u003d True"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def join_group(self):"},{"line_number":108,"context_line":"        \"\"\"Join service group.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_d111dfae","line":105,"in_reply_to":"bf51134e_d1cf1fae","updated":"2020-07-02 10:24:39.000000000","message":"Agree with both statements :)","commit_id":"8c07e056d06d71cffaf258a156361d71ca555d3b"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7ccea47cc6fc13a5eee04808e949b4838d1804f5","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    def run_elect_coordinator(self):"},{"line_number":150,"context_line":"        \"\"\"Trigger a new leader election.\"\"\""},{"line_number":151,"context_line":"        LOG.debug(\u0027Starting leader election\u0027)"},{"line_number":152,"context_line":"        self.coordinator.run_elect_coordinator()"},{"line_number":153,"context_line":"        LOG.debug(\u0027Finished leader election\u0027)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_31c49b92","line":152,"updated":"2020-07-02 09:58:20.000000000","message":"this can raise tooz.NotImplemented. maybe we need to store a flag whether leader election is supported?","commit_id":"8c07e056d06d71cffaf258a156361d71ca555d3b"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"74d1ae5f760ba74f3adad512b2d63a6890875e4b","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    def run_elect_coordinator(self):"},{"line_number":150,"context_line":"        \"\"\"Trigger a new leader election.\"\"\""},{"line_number":151,"context_line":"        LOG.debug(\u0027Starting leader election\u0027)"},{"line_number":152,"context_line":"        self.coordinator.run_elect_coordinator()"},{"line_number":153,"context_line":"        LOG.debug(\u0027Finished leader election\u0027)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_316bfb1f","line":152,"in_reply_to":"bf51134e_31c49b92","updated":"2020-07-02 10:24:39.000000000","message":"Done. I also added a warning which is now printed on every (failing) election as operators may miss the initial message about the lack of support in the backend.","commit_id":"8c07e056d06d71cffaf258a156361d71ca555d3b"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"4caeec4e5a4cae25284b8fba32ce06f0e31faa07","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        else:"},{"line_number":158,"context_line":"            LOG.warning(\u0027The coordination backend does not support leader \u0027"},{"line_number":159,"context_line":"                        \u0027elections, assuming we are a leader. This is \u0027"},{"line_number":160,"context_line":"                        \u0027deprecated, please use a supported backend.\u0027)"},{"line_number":161,"context_line":"            self.is_leader \u003d True"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"bf51134e_e027cf63","line":160,"updated":"2020-07-06 08:07:24.000000000","message":"Please remove, there is also logging on the initial election. This will spam the logs.","commit_id":"0d20064f44835d8abe91ef3e89daa8cbb25b0c48"}],"ironic_inspector/conductor/manager.py":[{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"91258e5a5686e05dd39d6c9e3acd0dc0fa5ef568","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            self._zeroconf.register_service(\u0027baremetal-introspection\u0027,"},{"line_number":109,"context_line":"                                            endpoint)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        self.coordinator \u003d None"},{"line_number":112,"context_line":"        try:"},{"line_number":113,"context_line":"            self.coordinator \u003d coordination.get_coordinator(prefix\u003d\u0027conductor\u0027)"},{"line_number":114,"context_line":"            self.coordinator.start(heartbeat\u003dTrue)"},{"line_number":115,"context_line":"            self.coordinator.join_group()"},{"line_number":116,"context_line":"        except Exception as exc:"},{"line_number":117,"context_line":"            if CONF.standalone:"},{"line_number":118,"context_line":"                LOG.info(\u0027Coordination backend cannot be started, assuming \u0027"},{"line_number":119,"context_line":"                         \u0027not other instances are running. Error: %s\u0027, exc)"},{"line_number":120,"context_line":"            else:"},{"line_number":121,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":122,"context_line":"                    LOG.critical(\u0027Failure when connecting to coordination \u0027"},{"line_number":123,"context_line":"                                 \u0027backend\u0027, exc_info\u003dTrue)"},{"line_number":124,"context_line":"                    self.del_host()"},{"line_number":125,"context_line":"        else:"},{"line_number":126,"context_line":"            LOG.info(\u0027Successfully connected to coordination backend.\u0027)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def del_host(self):"},{"line_number":129,"context_line":"        \"\"\"Shutdown the ironic inspector conductor service.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"bf51134e_85c49e41","line":126,"range":{"start_line":111,"start_character":0,"end_line":126,"end_character":71},"updated":"2020-06-25 14:55:49.000000000","message":"Shouldn\u0027t the coordination be moved and set up before the start of the periodic tasks we try to coordinate?","commit_id":"0cb2c3c3e8670eedad8c583e85c9f88dce199ca6"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"9dca3a2998dda7b2542e4c1df1ec9721c626cb3f","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        if self.coordinator is not None:"},{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                if self.coordinator.started:"},{"line_number":141,"context_line":"                    self.coordinator.leave_group()"},{"line_number":142,"context_line":"                    self.coordinator.stop()"},{"line_number":143,"context_line":"            except tooz.ToozError:"},{"line_number":144,"context_line":"                LOG.exception(\u0027Failed to stop coordinator\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf51134e_a45fe070","line":141,"range":{"start_line":141,"start_character":13,"end_line":141,"end_character":50},"updated":"2020-07-01 08:29:28.000000000","message":"wondering if we should add a call \u0027leave_group\u0027 to \u0027stop\u0027","commit_id":"c9d20c26f11b054d95e8eeee78ae939c10d9138d"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"9203ae6c5f8a32c3437da279c38ecedfe246633f","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        if self.coordinator is not None:"},{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                if self.coordinator.started:"},{"line_number":141,"context_line":"                    self.coordinator.leave_group()"},{"line_number":142,"context_line":"                    self.coordinator.stop()"},{"line_number":143,"context_line":"            except tooz.ToozError:"},{"line_number":144,"context_line":"                LOG.exception(\u0027Failed to stop coordinator\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf51134e_c412d462","line":141,"range":{"start_line":141,"start_character":13,"end_line":141,"end_character":50},"in_reply_to":"bf51134e_a45fe070","updated":"2020-07-01 08:42:29.000000000","message":"You don\u0027t have to be in a group when you stop ... but the code could of course check this, leave the group (if member) and then stop.\n\nI think this is a separate change, though, as it changes the semantics of coordinator.stop() which is not directly related to the leader election.","commit_id":"c9d20c26f11b054d95e8eeee78ae939c10d9138d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7ccea47cc6fc13a5eee04808e949b4838d1804f5","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"def periodic_leader_election(conductor):"},{"line_number":234,"context_line":"    if (conductor.coordinator is not None):"},{"line_number":235,"context_line":"        LOG.debug(\u0027Triggering leader election\u0027)"},{"line_number":236,"context_line":"        conductor.coordinator.run_elect_coordinator()"},{"line_number":237,"context_line":"    return"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_11c19781","line":234,"updated":"2020-07-02 09:58:20.000000000","message":"nit: redundant brackets","commit_id":"8c07e056d06d71cffaf258a156361d71ca555d3b"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"74d1ae5f760ba74f3adad512b2d63a6890875e4b","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"def periodic_leader_election(conductor):"},{"line_number":234,"context_line":"    if (conductor.coordinator is not None):"},{"line_number":235,"context_line":"        LOG.debug(\u0027Triggering leader election\u0027)"},{"line_number":236,"context_line":"        conductor.coordinator.run_elect_coordinator()"},{"line_number":237,"context_line":"    return"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_f15a2381","line":234,"in_reply_to":"bf51134e_11c19781","updated":"2020-07-02 10:24:39.000000000","message":"Done","commit_id":"8c07e056d06d71cffaf258a156361d71ca555d3b"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7ccea47cc6fc13a5eee04808e949b4838d1804f5","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"def periodic_leader_election(conductor):"},{"line_number":234,"context_line":"    if (conductor.coordinator is not None):"},{"line_number":235,"context_line":"        LOG.debug(\u0027Triggering leader election\u0027)"},{"line_number":236,"context_line":"        conductor.coordinator.run_elect_coordinator()"},{"line_number":237,"context_line":"    return"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_71be1300","line":235,"updated":"2020-07-02 09:58:20.000000000","message":"There is already logging inside of it","commit_id":"8c07e056d06d71cffaf258a156361d71ca555d3b"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"74d1ae5f760ba74f3adad512b2d63a6890875e4b","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"def periodic_leader_election(conductor):"},{"line_number":234,"context_line":"    if (conductor.coordinator is not None):"},{"line_number":235,"context_line":"        LOG.debug(\u0027Triggering leader election\u0027)"},{"line_number":236,"context_line":"        conductor.coordinator.run_elect_coordinator()"},{"line_number":237,"context_line":"    return"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_31549b54","line":235,"in_reply_to":"bf51134e_71be1300","updated":"2020-07-02 10:24:39.000000000","message":"Done","commit_id":"8c07e056d06d71cffaf258a156361d71ca555d3b"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"4caeec4e5a4cae25284b8fba32ce06f0e31faa07","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        # run elections periodically if we have a coordinator"},{"line_number":120,"context_line":"        # that we were able to start"},{"line_number":121,"context_line":"        if (self.coordinator and self.coordinator.started):"},{"line_number":122,"context_line":"            periodic_leader_election_ \u003d periodics.periodic("},{"line_number":123,"context_line":"                spacing\u003dCONF.leader_election_interval"},{"line_number":124,"context_line":"            )(periodic_leader_election)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bf51134e_c02a8b2a","line":121,"updated":"2020-07-06 08:07:24.000000000","message":"nit: redundant brackets","commit_id":"0d20064f44835d8abe91ef3e89daa8cbb25b0c48"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"4caeec4e5a4cae25284b8fba32ce06f0e31faa07","unresolved":false,"context_lines":[{"line_number":233,"context_line":"def periodic_leader_election(conductor):"},{"line_number":234,"context_line":"    if conductor.coordinator is not None:"},{"line_number":235,"context_line":"        conductor.coordinator.run_elect_coordinator()"},{"line_number":236,"context_line":"    return"}],"source_content_type":"text/x-python","patch_set":12,"id":"bf51134e_2021c74e","line":236,"updated":"2020-07-06 08:07:24.000000000","message":"nit: redundant","commit_id":"0d20064f44835d8abe91ef3e89daa8cbb25b0c48"}]}
