)]}'
{"ironic/conductor/manager.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"b8fe7219dc2a1e8917a5a6d4462b1422be4dc6bc","unresolved":false,"context_lines":[{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def del_host(self, deregister\u003dTrue):"},{"line_number":329,"context_line":"        # Conductor deregistration fails if called on non initialized"},{"line_number":330,"context_line":"        # conductor(e.g. when rpc server is unreachable)."},{"line_number":331,"context_line":"        if not hasattr(self, \u0027conductor\u0027):"},{"line_number":332,"context_line":"            return"},{"line_number":333,"context_line":"        self._keepalive_evt.set()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_7bac9e8c","line":330,"updated":"2015-09-21 09:04:51.000000000","message":"nit: non-initialized; also need space before (","commit_id":"5e34da3c4bb436a9fb131989b9ee96c368756edd"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"157848941569fa7bd7ac08bf3450c2f1a2538cbb","unresolved":false,"context_lines":[{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def del_host(self, deregister\u003dTrue):"},{"line_number":329,"context_line":"        # Conductor deregistration fails if called on non initialized"},{"line_number":330,"context_line":"        # conductor(e.g. when rpc server is unreachable)."},{"line_number":331,"context_line":"        if not hasattr(self, \u0027conductor\u0027):"},{"line_number":332,"context_line":"            return"},{"line_number":333,"context_line":"        self._keepalive_evt.set()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_7b4d7ec3","line":330,"in_reply_to":"ba15a1d1_7bac9e8c","updated":"2015-09-21 09:10:45.000000000","message":"Done","commit_id":"5e34da3c4bb436a9fb131989b9ee96c368756edd"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"aa59216baa4312b0eeb055910e66b5e2f0655e50","unresolved":false,"context_lines":[{"line_number":328,"context_line":"    def del_host(self, deregister\u003dTrue):"},{"line_number":329,"context_line":"        # Conductor deregistration fails if called on non-initialized"},{"line_number":330,"context_line":"        # conductor (e.g. when rpc server is unreachable)."},{"line_number":331,"context_line":"        if not hasattr(self, \u0027conductor\u0027):"},{"line_number":332,"context_line":"            return"},{"line_number":333,"context_line":"        self._keepalive_evt.set()"},{"line_number":334,"context_line":"        if deregister:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_c3fb7c46","line":331,"updated":"2015-09-21 12:28:32.000000000","message":"According to the bug, del_host fails because self._keepalive_evt is not set, not because self.conductor is not set... why use self.conductor here? \n\nIf something goes wrong in init_host between setting self._keepalive_evt and self.conductor, we\u0027ll stop here, and the heartbeat thread will never stop because self._keepalive_evt.set() will never be called.","commit_id":"5d8e830433becdbcc62dc57544b1e1cb4519620c"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"eb411d7703c6e81855e9c4ae4862d8b5f8efe8f9","unresolved":false,"context_lines":[{"line_number":328,"context_line":"    def del_host(self, deregister\u003dTrue):"},{"line_number":329,"context_line":"        # Conductor deregistration fails if called on non-initialized"},{"line_number":330,"context_line":"        # conductor (e.g. when rpc server is unreachable)."},{"line_number":331,"context_line":"        if not hasattr(self, \u0027conductor\u0027):"},{"line_number":332,"context_line":"            return"},{"line_number":333,"context_line":"        self._keepalive_evt.set()"},{"line_number":334,"context_line":"        if deregister:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_8e112bb2","line":331,"in_reply_to":"ba15a1d1_4311ac5c","updated":"2015-09-21 12:52:37.000000000","message":"it was done in that way because we use not only _keepalive_evt, there is dbapi also, so check \u0027conductor\u0027 attr seems reasonable for me. As for thread, as Dmitry mentioned above, thanks,  it is spawned after conductor init.","commit_id":"5d8e830433becdbcc62dc57544b1e1cb4519620c"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a6520481fc636d63ef711e48676c93921e4ce385","unresolved":false,"context_lines":[{"line_number":328,"context_line":"    def del_host(self, deregister\u003dTrue):"},{"line_number":329,"context_line":"        # Conductor deregistration fails if called on non-initialized"},{"line_number":330,"context_line":"        # conductor (e.g. when rpc server is unreachable)."},{"line_number":331,"context_line":"        if not hasattr(self, \u0027conductor\u0027):"},{"line_number":332,"context_line":"            return"},{"line_number":333,"context_line":"        self._keepalive_evt.set()"},{"line_number":334,"context_line":"        if deregister:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_4311ac5c","line":331,"in_reply_to":"ba15a1d1_c3fb7c46","updated":"2015-09-21 12:33:37.000000000","message":"Jim, if I read above code correctly (I was also wondering about the same), we do initialize _keepalive_evt earlier, but we only start the thread itself after self.conductor is initialized.","commit_id":"5d8e830433becdbcc62dc57544b1e1cb4519620c"}],"ironic/tests/conductor/test_manager.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"b8fe7219dc2a1e8917a5a6d4462b1422be4dc6bc","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        self.assertEqual(self.hostname, res[\u0027hostname\u0027])"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    @mock.patch.object(manager.ConductorManager, \u0027init_host\u0027)"},{"line_number":212,"context_line":"    def test_doesnt_del_host_unregister_conductor(self, mock_init):"},{"line_number":213,"context_line":"        self._start_service()"},{"line_number":214,"context_line":"        try:"},{"line_number":215,"context_line":"            self.service.del_host()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_9ba9727e","line":212,"updated":"2015-09-21 09:04:51.000000000","message":"what about calling it test_stop_uninitialized_conductor?","commit_id":"5e34da3c4bb436a9fb131989b9ee96c368756edd"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"157848941569fa7bd7ac08bf3450c2f1a2538cbb","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        self.assertEqual(self.hostname, res[\u0027hostname\u0027])"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    @mock.patch.object(manager.ConductorManager, \u0027init_host\u0027)"},{"line_number":212,"context_line":"    def test_doesnt_del_host_unregister_conductor(self, mock_init):"},{"line_number":213,"context_line":"        self._start_service()"},{"line_number":214,"context_line":"        try:"},{"line_number":215,"context_line":"            self.service.del_host()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_5b7d1ae6","line":212,"in_reply_to":"ba15a1d1_9ba9727e","updated":"2015-09-21 09:10:45.000000000","message":"Done","commit_id":"5e34da3c4bb436a9fb131989b9ee96c368756edd"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"b8fe7219dc2a1e8917a5a6d4462b1422be4dc6bc","unresolved":false,"context_lines":[{"line_number":214,"context_line":"        try:"},{"line_number":215,"context_line":"            self.service.del_host()"},{"line_number":216,"context_line":"        except AttributeError:"},{"line_number":217,"context_line":"            self.fail(\u0027Trying unregister host for not initialized conductor.\u0027)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    @mock.patch.object(driver_factory.DriverFactory, \u0027__getitem__\u0027,"},{"line_number":220,"context_line":"                       lambda *args: mock.MagicMock())"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_3bb5c6cf","line":217,"updated":"2015-09-21 09:04:51.000000000","message":"this try block is not needed at all, just call self.service.del_host() to make sure it doesn\u0027t raise","commit_id":"5e34da3c4bb436a9fb131989b9ee96c368756edd"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"157848941569fa7bd7ac08bf3450c2f1a2538cbb","unresolved":false,"context_lines":[{"line_number":214,"context_line":"        try:"},{"line_number":215,"context_line":"            self.service.del_host()"},{"line_number":216,"context_line":"        except AttributeError:"},{"line_number":217,"context_line":"            self.fail(\u0027Trying unregister host for not initialized conductor.\u0027)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    @mock.patch.object(driver_factory.DriverFactory, \u0027__getitem__\u0027,"},{"line_number":220,"context_line":"                       lambda *args: mock.MagicMock())"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_3b1146b0","line":217,"in_reply_to":"ba15a1d1_3bb5c6cf","updated":"2015-09-21 09:10:45.000000000","message":"ok, just want do it explicitly","commit_id":"5e34da3c4bb436a9fb131989b9ee96c368756edd"}]}
