)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"99effa9eccd049000851efbd02fec5d3b64d9495","unresolved":false,"context_lines":[{"line_number":10,"context_line":"and stderr readers and kills the process. There exists an end case (as"},{"line_number":11,"context_line":"described in the bug report) in which after the readers have been"},{"line_number":12,"context_line":"stopped the sub-process will generate a substantial amount of outputs to"},{"line_number":13,"context_line":"either fd. Since the \u0027subprocess\u0027 module is lunched with subprocess.PIPE"},{"line_number":14,"context_line":"as stdout/stderr, and since Linux\u0027s pipes can be filled to the point"},{"line_number":15,"context_line":"where writing new data to them will block, this may cause a deadlock if"},{"line_number":16,"context_line":"the sub-process has a signal handler for the signal (for example, the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a29b11f_7cf1f4cc","line":13,"updated":"2015-10-19 09:05:02.000000000","message":"s/lunched/launched/","commit_id":"2fbf4dd1e9cfff0abf4ec0b939cab943e83a4c8c"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"ff46ff89e1f59cde602067eb329e9e3faa76b093","unresolved":false,"context_lines":[{"line_number":10,"context_line":"and stderr readers and kills the process. There exists an end case (as"},{"line_number":11,"context_line":"described in the bug report) in which after the readers have been"},{"line_number":12,"context_line":"stopped the sub-process will generate a substantial amount of outputs to"},{"line_number":13,"context_line":"either fd. Since the \u0027subprocess\u0027 module is lunched with subprocess.PIPE"},{"line_number":14,"context_line":"as stdout/stderr, and since Linux\u0027s pipes can be filled to the point"},{"line_number":15,"context_line":"where writing new data to them will block, this may cause a deadlock if"},{"line_number":16,"context_line":"the sub-process has a signal handler for the signal (for example, the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a29b11f_43b2d495","line":13,"in_reply_to":"3a29b11f_7cf1f4cc","updated":"2015-10-20 11:58:52.000000000","message":"Done","commit_id":"2fbf4dd1e9cfff0abf4ec0b939cab943e83a4c8c"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"99effa9eccd049000851efbd02fec5d3b64d9495","unresolved":false,"context_lines":[{"line_number":16,"context_line":"the sub-process has a signal handler for the signal (for example, the"},{"line_number":17,"context_line":"process is handling SIGTERM to produce a graceful exit of the program)."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Therefor, this patch proposes to only kill the readers until AFTER"},{"line_number":20,"context_line":"wait() returned and the process truly died. Also, relying on _kill_event"},{"line_number":21,"context_line":"had to cease since invoking its send() method caused a logical loop back"},{"line_number":22,"context_line":"to _kill, causing eventlet errors."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a29b11f_fcb3c408","line":19,"updated":"2015-10-19 09:05:02.000000000","message":"s/Therefor/Therefore/","commit_id":"2fbf4dd1e9cfff0abf4ec0b939cab943e83a4c8c"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"ff46ff89e1f59cde602067eb329e9e3faa76b093","unresolved":false,"context_lines":[{"line_number":16,"context_line":"the sub-process has a signal handler for the signal (for example, the"},{"line_number":17,"context_line":"process is handling SIGTERM to produce a graceful exit of the program)."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Therefor, this patch proposes to only kill the readers until AFTER"},{"line_number":20,"context_line":"wait() returned and the process truly died. Also, relying on _kill_event"},{"line_number":21,"context_line":"had to cease since invoking its send() method caused a logical loop back"},{"line_number":22,"context_line":"to _kill, causing eventlet errors."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a29b11f_437974c7","line":19,"in_reply_to":"3a29b11f_fcb3c408","updated":"2015-10-20 11:58:52.000000000","message":"Done","commit_id":"2fbf4dd1e9cfff0abf4ec0b939cab943e83a4c8c"}],"neutron/agent/linux/async_process.py":[{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"99effa9eccd049000851efbd02fec5d3b64d9495","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            self._is_running \u003d False"},{"line_number":168,"context_line":"            self._kill_process(pid, kill_signal)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        # Halt the greenthreads if they weren\u0027t already."},{"line_number":171,"context_line":"        if self._kill_event:"},{"line_number":172,"context_line":"            self._kill_event.send()"},{"line_number":173,"context_line":"            self._kill_event \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a29b11f_7caa541b","line":170,"updated":"2015-10-19 09:05:02.000000000","message":"_kill now ignores respawning arg.","commit_id":"2fbf4dd1e9cfff0abf4ec0b939cab943e83a4c8c"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"ff46ff89e1f59cde602067eb329e9e3faa76b093","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            self._is_running \u003d False"},{"line_number":168,"context_line":"            self._kill_process(pid, kill_signal)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        # Halt the greenthreads if they weren\u0027t already."},{"line_number":171,"context_line":"        if self._kill_event:"},{"line_number":172,"context_line":"            self._kill_event.send()"},{"line_number":173,"context_line":"            self._kill_event \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a29b11f_a3164853","line":170,"in_reply_to":"3a29b11f_7caa541b","updated":"2015-10-20 11:58:52.000000000","message":"Done","commit_id":"2fbf4dd1e9cfff0abf4ec0b939cab943e83a4c8c"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"aabb07d9b6d592ae670877b286ad28bc812b8e2e","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                self._process.pid,"},{"line_number":157,"context_line":"                run_as_root\u003dself.run_as_root)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def _kill(self, kill_signal):"},{"line_number":160,"context_line":"        \"\"\"Kill the process and the associated watcher greenthreads.\"\"\""},{"line_number":161,"context_line":"        pid \u003d self.pid"},{"line_number":162,"context_line":"        if pid:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_001b0ecb","line":159,"updated":"2015-10-22 07:27:46.000000000","message":"The respawning arg is trying to prevent spawn race condition,\nand your patch seems to have the race condition.","commit_id":"80df6429af3f868ccb7fdc6b6ae1dbd8f8b24937"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"4db6807c4eae4a827d0147f1751631f38c3cfded","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                self._process.pid,"},{"line_number":157,"context_line":"                run_as_root\u003dself.run_as_root)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def _kill(self, kill_signal):"},{"line_number":160,"context_line":"        \"\"\"Kill the process and the associated watcher greenthreads.\"\"\""},{"line_number":161,"context_line":"        pid \u003d self.pid"},{"line_number":162,"context_line":"        if pid:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_bb7febde","line":159,"in_reply_to":"3a29b11f_001b0ecb","updated":"2015-10-22 07:57:40.000000000","message":"Can you clarify exactly what kind of race condition it prevents? I\u0027m not really clear on that.","commit_id":"80df6429af3f868ccb7fdc6b6ae1dbd8f8b24937"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"a496737e16a4e1ed9d83cbc4c2a8a96edac13d08","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                self._process.pid,"},{"line_number":157,"context_line":"                run_as_root\u003dself.run_as_root)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def _kill(self, kill_signal):"},{"line_number":160,"context_line":"        \"\"\"Kill the process and the associated watcher greenthreads.\"\"\""},{"line_number":161,"context_line":"        pid \u003d self.pid"},{"line_number":162,"context_line":"        if pid:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a26ad4f_e717ca52","line":159,"in_reply_to":"3a29b11f_76c7fa95","updated":"2015-10-29 13:02:44.000000000","message":"You are correct, though there is another race condition in this area of code: when a child process errors, _handle_process_error will be ran twice - this can cause 2 processes to start instead of one. I\u0027ve fixed this by setting _is_running to False when an error occurs.\n\nThis fix also solves the race condition you mentioned - now when start() will run, _is_running will be False and the process will spawn correctly. As for the case where start() is called right when the process is respawned, I\u0027ve changed to code to call start() instead, which makes sure that the process is not running before trying to run it again.","commit_id":"80df6429af3f868ccb7fdc6b6ae1dbd8f8b24937"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"bad3576ca4e00cb70a77f4c399e9021578e0125c","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                self._process.pid,"},{"line_number":157,"context_line":"                run_as_root\u003dself.run_as_root)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def _kill(self, kill_signal):"},{"line_number":160,"context_line":"        \"\"\"Kill the process and the associated watcher greenthreads.\"\"\""},{"line_number":161,"context_line":"        pid \u003d self.pid"},{"line_number":162,"context_line":"        if pid:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_76c7fa95","line":159,"in_reply_to":"3a29b11f_bb7febde","updated":"2015-10-23 08:30:49.000000000","message":"On a child process error, _handle_process_error is called and the function sleeps in eventlet.sleep on line 195.  start() can be called meanwhile.\n\nIn the original code, such race condition is prevented by the use of self._kill_event.\n\nI think what you need to do is simply skip line 163 when respawing is true, but please check by yourself.","commit_id":"80df6429af3f868ccb7fdc6b6ae1dbd8f8b24937"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"97bce731b5d3cbc7b7e30fef9b9d235d4c026bcc","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if self._is_running:"},{"line_number":109,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            LOG.debug(\u0027Launching async process [%s].\u0027, self.cmd)"},{"line_number":112,"context_line":"            self._spawn()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if block:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_09e8d415","line":111,"updated":"2015-11-13 01:06:59.000000000","message":"LOG.debug calls write(), which can cause an eventlet context switch, so there is a race window.\n\nPlease move this line above line 108 to avoid this.","commit_id":"b473a4a44ae965fccc2576d3ab222b3fbf330ac2"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"b6811275d3f257bf5746e37953dfb0d5055b342e","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if self._is_running:"},{"line_number":109,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            LOG.debug(\u0027Launching async process [%s].\u0027, self.cmd)"},{"line_number":112,"context_line":"            self._spawn()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if block:"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba8a016a_9fe66d42","line":111,"in_reply_to":"ba8a016a_48f3079f","updated":"2015-11-19 16:21:21.000000000","message":"Thanks for that explanation, John","commit_id":"b473a4a44ae965fccc2576d3ab222b3fbf330ac2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"c840c1e991cf0daf31f6d7ab9f42254b024de561","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if self._is_running:"},{"line_number":109,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            LOG.debug(\u0027Launching async process [%s].\u0027, self.cmd)"},{"line_number":112,"context_line":"            self._spawn()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if block:"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba8a016a_48f3079f","line":111,"in_reply_to":"ba8a016a_c8ab7788","updated":"2015-11-17 10:03:03.000000000","message":"BTW, this is a real race condition (nice job catching this, Iwamoto) - when a process err\u0027s, 2 different greenthreads will run _handle_process_error(). This can ultimately lead to a race condition where one greenthreads decides it\u0027s safe to _spawn, but before it actually does goes over to the other greenthreads which does the same - leading to 2 processes instead of 1.","commit_id":"b473a4a44ae965fccc2576d3ab222b3fbf330ac2"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"1f321368a30fd4b82c300d77a2607afd5ff9ab86","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if self._is_running:"},{"line_number":109,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            LOG.debug(\u0027Launching async process [%s].\u0027, self.cmd)"},{"line_number":112,"context_line":"            self._spawn()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if block:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_cf3b879b","line":111,"in_reply_to":"da85f559_09e8d415","updated":"2015-11-13 17:05:20.000000000","message":"It doesn\u0027t look like this would be a new issue in this patch.\n\nCan you explain the race, though?  It would require two greenthreads calling start() with _is_running set to False.  It\u0027s not obvious to me when that would happen.","commit_id":"b473a4a44ae965fccc2576d3ab222b3fbf330ac2"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"9b15f910be091ecdc7cc3acb494e4a0416e490f1","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if self._is_running:"},{"line_number":109,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            LOG.debug(\u0027Launching async process [%s].\u0027, self.cmd)"},{"line_number":112,"context_line":"            self._spawn()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if block:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_94900f50","line":111,"in_reply_to":"da85f559_74c48b91","updated":"2015-11-16 01:33:49.000000000","message":"I\u0027m all for fixing it, I just wasn\u0027t sure how it could happen.\n\nI get that this could get called by the async process greenthread during respawn, but what other greenthread could be calling start at the same time?  That would only happen after this has already run and completed successfully from the original, calling greenthread.  What am I missing?","commit_id":"b473a4a44ae965fccc2576d3ab222b3fbf330ac2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"88b45a97070b0f97ee15dd02db8ade07de464c36","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if self._is_running:"},{"line_number":109,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            LOG.debug(\u0027Launching async process [%s].\u0027, self.cmd)"},{"line_number":112,"context_line":"            self._spawn()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if block:"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba8a016a_c8ab7788","line":111,"in_reply_to":"da85f559_94900f50","updated":"2015-11-17 09:59:51.000000000","message":"While there would be a race condition where Iwamoto said if write() would have been able to switch to other greenthreads, in fact write() does not do that at all. The relevant code is at [1] - file() and open() (which is what\u0027s used by python\u0027s logging) does not override the write() functions at all.\n\nAs proof, I present [2] - a simple code that demonstrate that once a greenthread enters write(), it will not switch to another greenthread, causing starvation. This starvation, therefore, makes this code safe.\n\nI\u0027m still gonna fix this though, as we probably don\u0027t want to run into this again if eventlet decides to fix their code.\n\n[1]: https://github.com/eventlet/eventlet/blob/master/eventlet/green/builtin.py#L28\n[2]: http://pastebin.com/bqCw9MrF","commit_id":"b473a4a44ae965fccc2576d3ab222b3fbf330ac2"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"80c8fb2090296ccb1ae32d0fe7be804c841b1e3a","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if self._is_running:"},{"line_number":109,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            LOG.debug(\u0027Launching async process [%s].\u0027, self.cmd)"},{"line_number":112,"context_line":"            self._spawn()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if block:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_74c48b91","line":111,"in_reply_to":"da85f559_cf3b879b","updated":"2015-11-16 01:18:09.000000000","message":"Hi Russel,\n\nif respawn_interval is set, _watch_process can call start() asynchronously.\nWhy not close this possible race window as the fix is obvious?","commit_id":"b473a4a44ae965fccc2576d3ab222b3fbf330ac2"}],"neutron/tests/unit/agent/linux/failing_process.py":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"128539419a3e0bf325dc6fba1fedd4db80649c6a","unresolved":false,"context_lines":[{"line_number":19,"context_line":"def main():"},{"line_number":20,"context_line":"    filename \u003d sys.argv[1]"},{"line_number":21,"context_line":"    if not os.path.exists(filename):"},{"line_number":22,"context_line":"        sys.exit(1)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da85f559_5de74ce4","line":22,"updated":"2015-11-09 15:47:21.000000000","message":"Why do you need the check here?  Don\u0027t you just want a program that exits non-zero?  If so, why not just execute \"exit 1\" ?  I suppose that\u0027s linux specific, but you could also execute a process that does something like \"python -c \u0027import sys; sys.exit(1)\u0027\".","commit_id":"2d1bdadf434b3721de2e05f7c3f718eb9eae24f4"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6d484b7cff2c63fac54243a7ed790a3550e1d34e","unresolved":false,"context_lines":[{"line_number":19,"context_line":"def main():"},{"line_number":20,"context_line":"    filename \u003d sys.argv[1]"},{"line_number":21,"context_line":"    if not os.path.exists(filename):"},{"line_number":22,"context_line":"        sys.exit(1)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da85f559_8be1c500","line":22,"in_reply_to":"da85f559_5de74ce4","updated":"2015-11-10 09:27:58.000000000","message":"Done","commit_id":"2d1bdadf434b3721de2e05f7c3f718eb9eae24f4"}],"neutron/tests/unit/agent/linux/test_async_process.py":[{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"51b278f0744d846fb06b649e396cf887b98c1ff9","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            self.proc._kill(signal.SIGKILL)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"            self.assertIsNone(self.proc._kill_event)"},{"line_number":174,"context_line":"            self.assertEqual(False, self.proc._is_running)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        mock_kill_event.send.assert_called_once_with()"},{"line_number":177,"context_line":"        if pid:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a29b11f_5574c266","line":174,"updated":"2015-10-20 13:29:28.000000000","message":"Please use assertFalse instead.","commit_id":"9108a6962fd5b8560e028579780055bd39c11464"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"06afd19dd64f7ab07c6ed222a0a215b36fe674ef","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            self.proc._kill(signal.SIGKILL)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"            self.assertIsNone(self.proc._kill_event)"},{"line_number":174,"context_line":"            self.assertEqual(False, self.proc._is_running)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        mock_kill_event.send.assert_called_once_with()"},{"line_number":177,"context_line":"        if pid:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a29b11f_e0918b9a","line":174,"in_reply_to":"3a29b11f_5574c266","updated":"2015-10-20 14:36:13.000000000","message":"Done","commit_id":"9108a6962fd5b8560e028579780055bd39c11464"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"0d8428ed443caa575f269fade8f17be8f1a1b9ef","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def test__kill_targets_process_for_pid(self):"},{"line_number":161,"context_line":"        pid \u003d 1"},{"line_number":162,"context_line":"        self.proc._kill_event \u003d eventlet.event.Event()"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        with mock.patch.object(self.proc, \u0027_kill_event\u0027"},{"line_number":165,"context_line":"                               ) as mock_kill_event,\\"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_954b3087","line":162,"updated":"2015-10-20 16:31:05.000000000","message":"Is this going to work since L164-L165 mock it again ?","commit_id":"80df6429af3f868ccb7fdc6b6ae1dbd8f8b24937"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"a496737e16a4e1ed9d83cbc4c2a8a96edac13d08","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def test__kill_targets_process_for_pid(self):"},{"line_number":161,"context_line":"        pid \u003d 1"},{"line_number":162,"context_line":"        self.proc._kill_event \u003d eventlet.event.Event()"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        with mock.patch.object(self.proc, \u0027_kill_event\u0027"},{"line_number":165,"context_line":"                               ) as mock_kill_event,\\"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a26ad4f_2d4a37c6","line":162,"in_reply_to":"3a29b11f_954b3087","updated":"2015-10-29 13:02:44.000000000","message":"I\u0027ve removed this bit from the code. Nice catch :)","commit_id":"80df6429af3f868ccb7fdc6b6ae1dbd8f8b24937"},{"author":{"_account_id":14591,"name":"Lubosz Kosnik (diltram)","email":"lubosz.kosnik@intel.com","username":"diltram"},"change_message_id":"0bc131e9dd381c7d3d6f874d3d9d10e02b4b9a0e","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def test__handle_process_error_no_crash_if_started(self):"},{"line_number":78,"context_line":"        self.proc._is_running \u003d True"},{"line_number":79,"context_line":"        with mock.patch.object(self.proc, \u0027_kill\u0027):"},{"line_number":80,"context_line":"            with mock.patch.object(self.proc, \u0027_spawn\u0027) as mock_spawn:"},{"line_number":81,"context_line":"                self.proc._handle_process_error()"},{"line_number":82,"context_line":"                mock_spawn.assert_not_called()"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a26ad4f_b04af3c3","line":79,"updated":"2015-10-30 16:18:36.000000000","message":"You can separate that mocks with comma:\nwith mock.xxxx(), mock.yyyy() as mock_spawn:","commit_id":"10b77d9d9336caf7808de8d3692fcff23fc9b63c"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"8ab87ddb20d683a1777852cdfcdb53a29d1f59ce","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def test__handle_process_error_no_crash_if_started(self):"},{"line_number":78,"context_line":"        self.proc._is_running \u003d True"},{"line_number":79,"context_line":"        with mock.patch.object(self.proc, \u0027_kill\u0027):"},{"line_number":80,"context_line":"            with mock.patch.object(self.proc, \u0027_spawn\u0027) as mock_spawn:"},{"line_number":81,"context_line":"                self.proc._handle_process_error()"},{"line_number":82,"context_line":"                mock_spawn.assert_not_called()"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa80f949_3c3c9a2e","line":79,"in_reply_to":"1a26ad4f_b04af3c3","updated":"2015-11-05 15:02:21.000000000","message":"This will force me to go down one line using an escaper (\u0027\\\u0027), leading to code that doesn\u0027t look good. I prefer to leave it as is.","commit_id":"10b77d9d9336caf7808de8d3692fcff23fc9b63c"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"9647d1f847d999dfc83883e2b0428e4136326519","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        with mock.patch.object(self.proc, \u0027_kill\u0027):"},{"line_number":80,"context_line":"            with mock.patch.object(self.proc, \u0027_spawn\u0027) as mock_spawn:"},{"line_number":81,"context_line":"                self.proc._handle_process_error()"},{"line_number":82,"context_line":"                mock_spawn.assert_not_called()"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _watch_process_exception():"},{"line_number":85,"context_line":"        raise Exception(\u0027Error!\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa80f949_022dc145","line":82,"updated":"2015-11-05 06:12:53.000000000","message":"Well, context tells me that you want test case for proc.start is called while proc._spawn is not called. If so, I think you may forget setting proc.respawn_interval in this test case, mock_spawn is not called for code never enter proc.start.","commit_id":"10b77d9d9336caf7808de8d3692fcff23fc9b63c"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"8ab87ddb20d683a1777852cdfcdb53a29d1f59ce","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        with mock.patch.object(self.proc, \u0027_kill\u0027):"},{"line_number":80,"context_line":"            with mock.patch.object(self.proc, \u0027_spawn\u0027) as mock_spawn:"},{"line_number":81,"context_line":"                self.proc._handle_process_error()"},{"line_number":82,"context_line":"                mock_spawn.assert_not_called()"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _watch_process_exception():"},{"line_number":85,"context_line":"        raise Exception(\u0027Error!\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa80f949_1cdd16e0","line":82,"in_reply_to":"fa80f949_022dc145","updated":"2015-11-05 15:02:21.000000000","message":"Done","commit_id":"10b77d9d9336caf7808de8d3692fcff23fc9b63c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6dd83fad6570466c9c02904eda8f28276a37f0e9","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                self.proc._handle_process_error()"},{"line_number":82,"context_line":"                mock_spawn.assert_not_called()"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _watch_process_exception():"},{"line_number":85,"context_line":"        raise Exception(\u0027Error!\u0027)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def _test__watch_process(self, callback, kill_event):"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba8a016a_4c619e38","line":84,"updated":"2015-11-18 09:08:07.000000000","message":"Note that this will raise TypeError because you miss self there.","commit_id":"e29ca5f3e737dd60420f8ac6b68307ba87def294"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"9e7ed6d1b14cb9a55893691ead186ab1e63a26c1","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                self.proc._handle_process_error()"},{"line_number":82,"context_line":"                mock_spawn.assert_not_called()"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _watch_process_exception():"},{"line_number":85,"context_line":"        raise Exception(\u0027Error!\u0027)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def _test__watch_process(self, callback, kill_event):"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba8a016a_0799d37b","line":84,"in_reply_to":"ba8a016a_4c619e38","updated":"2015-11-19 17:14:27.000000000","message":"Done","commit_id":"e29ca5f3e737dd60420f8ac6b68307ba87def294"}]}
