)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10215,"name":"Peter Stachowski","email":"peter@tesora.com","username":"peterstac"},"change_message_id":"e98178a52d678851fe6b73719740d31320b6ae1b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Update internal status when waiting for a change"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Keep the internal status up-to-date when waiting for a status change."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Ifd76229c30b631609c20abab3e0b39ff76e2a215"},{"line_number":12,"context_line":"Closes-Bug: 1514539"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da85f559_cf6710e9","line":9,"updated":"2015-11-13 14:27:41.000000000","message":"Feel free to add more info here (had to go to the bug to figure out why the change was necessary).","commit_id":"3bc1b21d84a132f04169fe4f3e9f5729bfe66bb3"}],"trove/guestagent/datastore/service.py":[{"author":{"_account_id":9782,"name":"Morgan Jones","email":"morgan@tesora.com","username":"vgnbkr"},"change_message_id":"800ec13d6671b80700d81319720b1eab423a5428","unresolved":false,"context_lines":[{"line_number":330,"context_line":"            LOG.debug(\"DB status was %s after %d seconds.\""},{"line_number":331,"context_line":"                      % (actual_status, waited_time))"},{"line_number":332,"context_line":"            # Always keep the internal status up-to-date."},{"line_number":333,"context_line":"            self.status \u003d actual_status"},{"line_number":334,"context_line":"            if actual_status \u003d\u003d status:"},{"line_number":335,"context_line":"                if update_db:"},{"line_number":336,"context_line":"                    # Cast a conductor message to also update the public status"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_7b33ef14","line":333,"updated":"2015-11-10 20:19:15.000000000","message":"Eliminate actual_status, just use self.status.  Also, comments are superfluous.","commit_id":"3ce30134c9096ee60c7915e30c7e44e44cf3690d"},{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"82ba799ac9062fd455d814b504887126d9e97481","unresolved":false,"context_lines":[{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    def wait_for_real_status_to_change_to(self, status, max_time,"},{"line_number":317,"context_line":"                                          update_db\u003dFalse):"},{"line_number":318,"context_line":"        \"\"\"Waits the given time for the real status to change to the one"},{"line_number":319,"context_line":"        specified."},{"line_number":320,"context_line":"        The internal status is always updated. The public instance"},{"line_number":321,"context_line":"        state stored in the Trove database is updated only if \"update_db\" is"}],"source_content_type":"text/x-python","patch_set":3,"id":"da85f559_cbb59bd0","line":318,"updated":"2015-11-15 12:20:46.000000000","message":"So as I understand it, this change is equivalent to\n\ns/actual_status/self.status/g\n\nOne thing that I don\u0027t understand about this code (and I didn\u0027t understand it when I made the recent change to update the amount of time waited) is why we only update the database only if self.status \u003d\u003d status.\n\nI think the code at 335 should look like ...\n\nif update_db:\n\n     self.set_status(self.status)\n\nif self.status \u003d\u003d status:\n\n     return True\n\n\nor if we think this will be too chatty, maybe throttle the update of status to only when the state changes (so we can follow loosely the state machine on the guest, with no guarantee that the polling will catch all state changes)\n\n\nyour thoughts?","commit_id":"65283e12aca453272663dfe36b7de5ff94cd3789"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"5b6387d05d61d08978659fb41b63c0e56c15e8c7","unresolved":false,"context_lines":[{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    def wait_for_real_status_to_change_to(self, status, max_time,"},{"line_number":317,"context_line":"                                          update_db\u003dFalse):"},{"line_number":318,"context_line":"        \"\"\"Waits the given time for the real status to change to the one"},{"line_number":319,"context_line":"        specified."},{"line_number":320,"context_line":"        The internal status is always updated. The public instance"},{"line_number":321,"context_line":"        state stored in the Trove database is updated only if \"update_db\" is"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_f1af7092","line":318,"in_reply_to":"da85f559_cbb59bd0","updated":"2015-11-16 15:43:06.000000000","message":"My understanding of this function would be something like this.\nIts purpose is to \u0027wait for an instance to acquire a given status\u0027. An optional side-effect is that the public instance status gets updated once the instance acquires the right state.\nMy guess is that it was originally written mainly for \u0027waiting for instance to go active\u0027. In that case one probably does not want to show all the intermediate states the instance might be going through.\n\nAt that time they probably used that mostly in \u0027prepare\u0027 but we now (after the Manager refactor) inhibit status updates during \u0027prepare\u0027 - that is the public status does not get updated until the prepare finishes, so the parameter no longer plays role there.\n\nThe start/stop/restart calls are also used by some backup/replication strategies - they likely still need to inhibit status updates during their operations.\n\nI don\u0027t think the problem is just about \u0027chattiness\u0027. Once instance enters a, say, \u0027BACKUP\u0027 state, it should not change until the backup finishes - what if it went \u0027ACTIVE\u0027 while the instance is still in the middle of its backup operations.\n\nJust my two cents... :-/","commit_id":"65283e12aca453272663dfe36b7de5ff94cd3789"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"56c2dc5054126e60de6ae085deeb60d773e4ecd1","unresolved":false,"context_lines":[{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    def wait_for_real_status_to_change_to(self, status, max_time,"},{"line_number":317,"context_line":"                                          update_db\u003dFalse):"},{"line_number":318,"context_line":"        \"\"\"Waits the given time for the real status to change to the one"},{"line_number":319,"context_line":"        specified."},{"line_number":320,"context_line":"        The internal status is always updated. The public instance"},{"line_number":321,"context_line":"        state stored in the Trove database is updated only if \"update_db\" is"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_51775c02","line":318,"in_reply_to":"da85f559_cbb59bd0","updated":"2015-11-16 15:47:03.000000000","message":"Oh I see, your code should not cause any troubles with backup etc as it does not update the public state unless update_db\u003dTrue.\nWell then I guess it\u0027s then mostly about the chattiness...","commit_id":"65283e12aca453272663dfe36b7de5ff94cd3789"}]}
