)]}'
{"neutron/agent/linux/async_process.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6188c52173b479536e66e1a3e5ca36ec673ca8b8","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                if not callback():"},{"line_number":105,"context_line":"                    break"},{"line_number":106,"context_line":"            except Exception:"},{"line_number":107,"context_line":"                LOG.exception(_(\u0027An error occured while communicating\u0027"},{"line_number":108,"context_line":"                                \u0027with the async process.\u0027))"},{"line_number":109,"context_line":"                break"},{"line_number":110,"context_line":"        if not kill_event.ready():"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAASn%2F%2FNjQ%3D","line":107,"updated":"2013-09-09 21:49:10.000000000","message":"space at the end of the line","commit_id":"f7f8265a4990fc282ee800c61a7ca96f93479c65"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"149312629ac4ead076634b9094e2cdded3167d3b","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                if not callback():"},{"line_number":105,"context_line":"                    break"},{"line_number":106,"context_line":"            except Exception:"},{"line_number":107,"context_line":"                LOG.exception(_(\u0027An error occured while communicating\u0027"},{"line_number":108,"context_line":"                                \u0027with the async process.\u0027))"},{"line_number":109,"context_line":"                break"},{"line_number":110,"context_line":"        if not kill_event.ready():"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAASn%2F%2FNTs%3D","line":107,"in_reply_to":"AAAASn%2F%2FNjQ%3D","updated":"2013-09-09 23:23:35.000000000","message":"Done","commit_id":"f7f8265a4990fc282ee800c61a7ca96f93479c65"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class AsyncProcessException(Exception):"},{"line_number":30,"context_line":"    pass"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class AsyncProcess(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FziI%3D","line":30,"updated":"2013-09-18 22:59:22.000000000","message":"nit: consider adding the exception in neutron.common.exceptions\n\nThis is an optional comment.","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class AsyncProcessException(Exception):"},{"line_number":30,"context_line":"    pass"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class AsyncProcess(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FZVU%3D","line":30,"in_reply_to":"AAAAS3%2F%2FziI%3D","updated":"2013-09-27 18:50:33.000000000","message":"I chose not to define the exception centrally because I thought it unlikely that it would be reused by other modules and therefore shouldn\u0027t clutter the common exception namespace.  Is the policy that all exceptions, regardless of scope, should be defined in the common namespace?  I\u0027ll happily make the suggested change if so.","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self._process, cmd \u003d utils.create_process(self.cmd,"},{"line_number":79,"context_line":"                                                  root_helper\u003dself.root_helper)"},{"line_number":80,"context_line":"        self._watchers \u003d []"},{"line_number":81,"context_line":"        for reader in [self._read_stdout, self._read_stderr]:"},{"line_number":82,"context_line":"            # Pass the stop event directly to the greenthread to"},{"line_number":83,"context_line":"            # ensure that assignment of a new event to the instance"},{"line_number":84,"context_line":"            # attribute does not prevent the greenthread from using"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2Fzh4%3D","line":81,"updated":"2013-09-18 22:59:22.000000000","message":"nit: consider using a tuple rather than a list","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self._process, cmd \u003d utils.create_process(self.cmd,"},{"line_number":79,"context_line":"                                                  root_helper\u003dself.root_helper)"},{"line_number":80,"context_line":"        self._watchers \u003d []"},{"line_number":81,"context_line":"        for reader in [self._read_stdout, self._read_stderr]:"},{"line_number":82,"context_line":"            # Pass the stop event directly to the greenthread to"},{"line_number":83,"context_line":"            # ensure that assignment of a new event to the instance"},{"line_number":84,"context_line":"            # attribute does not prevent the greenthread from using"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FapA%3D","line":81,"in_reply_to":"AAAAS3%2F%2Fzh4%3D","updated":"2013-09-27 18:50:33.000000000","message":"Done.\n\nWhat is the reason, and should that reason appear in HACKING?","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    def _handle_watcher_failure(self):"},{"line_number":92,"context_line":"        \"\"\"Kill the async process and respawn if necessary.\"\"\""},{"line_number":93,"context_line":"        LOG.debug(_(\u0027Halting async process in response to an error.\u0027))"},{"line_number":94,"context_line":"        respawning \u003d self.respawn_interval is not None"},{"line_number":95,"context_line":"        self._kill(respawning\u003drespawning)"},{"line_number":96,"context_line":"        if respawning:"},{"line_number":97,"context_line":"            eventlet.sleep(self.respawn_interval)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FzhU%3D","line":94,"updated":"2013-09-18 22:59:22.000000000","message":"If I read the docstring correctly, respawning should be true when self.respawn_internal is non zero. In this case it appears it will be True even when respawn_interval \u003d\u003d 0","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    def _handle_watcher_failure(self):"},{"line_number":92,"context_line":"        \"\"\"Kill the async process and respawn if necessary.\"\"\""},{"line_number":93,"context_line":"        LOG.debug(_(\u0027Halting async process in response to an error.\u0027))"},{"line_number":94,"context_line":"        respawning \u003d self.respawn_interval is not None"},{"line_number":95,"context_line":"        self._kill(respawning\u003drespawning)"},{"line_number":96,"context_line":"        if respawning:"},{"line_number":97,"context_line":"            eventlet.sleep(self.respawn_interval)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FapE%3D","line":94,"in_reply_to":"AAAAS3%2F%2FzhU%3D","updated":"2013-09-27 18:50:33.000000000","message":"Done.\n\nRespawning should be True if a respawn_interval \u003e\u003d 0 is provided, False otherwise (including if no value the value is None).  I\u0027ve updated the docstring and added validation to hopefully clarify this.","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    break"},{"line_number":106,"context_line":"            except Exception:"},{"line_number":107,"context_line":"                LOG.exception(_(\u0027An error occured while communicating \u0027"},{"line_number":108,"context_line":"                                \u0027with the async process.\u0027))"},{"line_number":109,"context_line":"                break"},{"line_number":110,"context_line":"        if not kill_event.ready():"},{"line_number":111,"context_line":"            self._handle_watcher_failure()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2Fzek%3D","line":108,"updated":"2013-09-18 22:59:22.000000000","message":"for log purposes it would probably be a goot idea to include the cmd in the message. This will help read logs if there are multiple concurrent async processes.","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    break"},{"line_number":106,"context_line":"            except Exception:"},{"line_number":107,"context_line":"                LOG.exception(_(\u0027An error occured while communicating \u0027"},{"line_number":108,"context_line":"                                \u0027with the async process.\u0027))"},{"line_number":109,"context_line":"                break"},{"line_number":110,"context_line":"        if not kill_event.ready():"},{"line_number":111,"context_line":"            self._handle_watcher_failure()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FY5A%3D","line":108,"in_reply_to":"AAAAS3%2F%2Fzek%3D","updated":"2013-09-27 18:50:33.000000000","message":"Done","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                LOG.exception(_(\u0027An error occured while communicating \u0027"},{"line_number":108,"context_line":"                                \u0027with the async process.\u0027))"},{"line_number":109,"context_line":"                break"},{"line_number":110,"context_line":"        if not kill_event.ready():"},{"line_number":111,"context_line":"            self._handle_watcher_failure()"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def _read_stdout(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2Fzg4%3D","line":110,"updated":"2013-09-18 22:59:22.000000000","message":"is while ... else something worth using in this method?","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                LOG.exception(_(\u0027An error occured while communicating \u0027"},{"line_number":108,"context_line":"                                \u0027with the async process.\u0027))"},{"line_number":109,"context_line":"                break"},{"line_number":110,"context_line":"        if not kill_event.ready():"},{"line_number":111,"context_line":"            self._handle_watcher_failure()"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def _read_stdout(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FY70%3D","line":110,"in_reply_to":"AAAAS3%2F%2Fzg4%3D","updated":"2013-09-27 18:50:33.000000000","message":"I would say no, since lines 102 and 110 use the same conditional.  This is because execution of line 110 may be due to the loop condition on 102 being satisfied or if the loop was broken out of.  If the loop was broken out of, it is necessary to check whether cleanup is required.\n\nI\u0027ve added a docstring that I hope clarifies this.","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        if data:"},{"line_number":123,"context_line":"            data \u003d data.strip()"},{"line_number":124,"context_line":"            self._stderr_lines.put(data)"},{"line_number":125,"context_line":"            return data"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def start(self):"},{"line_number":128,"context_line":"        \"\"\"Launch a process and monitor it asynchronously.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FzdU%3D","line":125,"updated":"2013-09-18 22:59:22.000000000","message":"just for the sake of pedantry, consider:\n\ndef _read(self, stream, queue):\n     data \u003d stream.readline()\n     if data:\n         data \u003d data.strip()\n         queue.put(data)\n         return data\n\ndef _read_stdout(self):\n      return self._read(self._process.stdout, self._stdout_lines)\n\ndef _read_stderr(self):\n      return self._read(self._process.stderr, self._stderr_lines)","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        if data:"},{"line_number":123,"context_line":"            data \u003d data.strip()"},{"line_number":124,"context_line":"            self._stderr_lines.put(data)"},{"line_number":125,"context_line":"            return data"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def start(self):"},{"line_number":128,"context_line":"        \"\"\"Launch a process and monitor it asynchronously.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FY1U%3D","line":125,"in_reply_to":"AAAAS3%2F%2FzdU%3D","updated":"2013-09-27 18:50:33.000000000","message":"Done","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":131,"context_line":"        else:"},{"line_number":132,"context_line":"            LOG.debug(_(\u0027Launching async process.\u0027))"},{"line_number":133,"context_line":"            self._spawn()"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _iter_queue(self, queue):"},{"line_number":136,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2Fzc8%3D","line":133,"updated":"2013-09-18 22:59:22.000000000","message":"in this cases, logging the cmd name would be helpful probably.","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":131,"context_line":"        else:"},{"line_number":132,"context_line":"            LOG.debug(_(\u0027Launching async process.\u0027))"},{"line_number":133,"context_line":"            self._spawn()"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _iter_queue(self, queue):"},{"line_number":136,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FY3I%3D","line":133,"in_reply_to":"AAAAS3%2F%2Fzc8%3D","updated":"2013-09-27 18:50:33.000000000","message":"Done","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    def iter_stderr(self):"},{"line_number":146,"context_line":"        return self._iter_queue(self._stderr_lines)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _kill(self, respawning\u003dFalse):"},{"line_number":149,"context_line":"        \"\"\"Kill the process and the associated watcher greenthreads."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        :param respawning: Optional, whether respawn will be subsequently"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FzhI%3D","line":148,"updated":"2013-09-18 22:59:22.000000000","message":"optional comment: to enhance readability, I would consider moving this method and the next one above, precisely between _spawn and _handle_watcher_failure","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    def iter_stderr(self):"},{"line_number":146,"context_line":"        return self._iter_queue(self._stderr_lines)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _kill(self, respawning\u003dFalse):"},{"line_number":149,"context_line":"        \"\"\"Kill the process and the associated watcher greenthreads."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        :param respawning: Optional, whether respawn will be subsequently"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FY1c%3D","line":148,"in_reply_to":"AAAAS3%2F%2FzhI%3D","updated":"2013-09-27 18:50:33.000000000","message":"Done","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f78de6ca8cd4d4ae655ade3e1e79c4a1d85c1924","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _kill_process(self):"},{"line_number":165,"context_line":"        pid \u003d self._process.pid"},{"line_number":166,"context_line":"        # If root helper was used, kill the children instead of the parent"},{"line_number":167,"context_line":"        if self.root_helper:"},{"line_number":168,"context_line":"            child_pids \u003d utils.find_child_pids(pid)"},{"line_number":169,"context_line":"            for child_pid in child_pids:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2Fw%2Fs%3D","line":166,"updated":"2013-09-19 18:19:52.000000000","message":"This seems rather obscure. Also, do you really need sudo to kill a child process?","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _kill_process(self):"},{"line_number":165,"context_line":"        pid \u003d self._process.pid"},{"line_number":166,"context_line":"        # If root helper was used, kill the children instead of the parent"},{"line_number":167,"context_line":"        if self.root_helper:"},{"line_number":168,"context_line":"            child_pids \u003d utils.find_child_pids(pid)"},{"line_number":169,"context_line":"            for child_pid in child_pids:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2Faqs%3D","line":166,"in_reply_to":"AAAAS3%2F%2Fw%2Fs%3D","updated":"2013-09-27 18:50:33.000000000","message":"According to my experience, invoking a process with the root helper creates two processes:\n\n- the root helper process (e.g. sudo myscript)\n- the child process (e.g. myscript)\n\nKilling the root helper process leaves the child process as a zombie, and the only way to ensure that both die is to kill the child process.\nI\u0027ll happily accept evidence to the contrary!\n\nAlso, if a root helper is used, the child process will be running as root, necessitating the use of the same root helper to kill it.\n\nI\u0027ve added comments to this effect in the code.","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"64b3c432e7abca11a2f96f62517036f45074332f","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        self.cmd \u003d cmd"},{"line_number":67,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":68,"context_line":"        if respawn_interval is not None and respawn_interval \u003c 0:"},{"line_number":69,"context_line":"            raise ValueError(\u0027respawn_interval must be \u003e\u003d 0 if provided.\u0027)"},{"line_number":70,"context_line":"        self.respawn_interval \u003d respawn_interval"},{"line_number":71,"context_line":"        self._process \u003d None"},{"line_number":72,"context_line":"        self._kill_event \u003d None"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAS3%2F%2FEIM%3D","line":69,"updated":"2013-10-05 04:02:14.000000000","message":"minor: i18n support can be added","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0e45cb7ebe6f609ebaa8dd0eab69c2b187bec85c","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        self.cmd \u003d cmd"},{"line_number":67,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":68,"context_line":"        if respawn_interval is not None and respawn_interval \u003c 0:"},{"line_number":69,"context_line":"            raise ValueError(\u0027respawn_interval must be \u003e\u003d 0 if provided.\u0027)"},{"line_number":70,"context_line":"        self.respawn_interval \u003d respawn_interval"},{"line_number":71,"context_line":"        self._process \u003d None"},{"line_number":72,"context_line":"        self._kill_event \u003d None"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATH%2F%2F%2Bns%3D","line":69,"in_reply_to":"AAAAS3%2F%2FEIM%3D","updated":"2013-10-07 07:13:13.000000000","message":"Done","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"64b3c432e7abca11a2f96f62517036f45074332f","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        if self._kill_event:"},{"line_number":80,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":81,"context_line":"        else:"},{"line_number":82,"context_line":"            LOG.debug(_(\u0027Launching async process [%(cmd)s.\u0027) %"},{"line_number":83,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":84,"context_line":"            self._spawn()"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAS3%2F%2FEII%3D","line":82,"updated":"2013-10-05 04:02:14.000000000","message":"minor: % can be \u0027,\u0027","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0e45cb7ebe6f609ebaa8dd0eab69c2b187bec85c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        if self._kill_event:"},{"line_number":80,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":81,"context_line":"        else:"},{"line_number":82,"context_line":"            LOG.debug(_(\u0027Launching async process [%(cmd)s.\u0027) %"},{"line_number":83,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":84,"context_line":"            self._spawn()"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATH%2F%2F%2Bno%3D","line":82,"in_reply_to":"AAAAS3%2F%2FEII%3D","updated":"2013-10-07 07:13:13.000000000","message":"Done","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"64b3c432e7abca11a2f96f62517036f45074332f","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    def stop(self):"},{"line_number":87,"context_line":"        \"\"\"Halt the process and watcher threads.\"\"\""},{"line_number":88,"context_line":"        if self._kill_event:"},{"line_number":89,"context_line":"            LOG.debug(_(\u0027Halting async process [%(cmd)s].\u0027) %"},{"line_number":90,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":91,"context_line":"            self._kill()"},{"line_number":92,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAS3%2F%2FEIA%3D","line":89,"updated":"2013-10-05 04:02:14.000000000","message":"minor: % can  be \u0027,\u0027","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0e45cb7ebe6f609ebaa8dd0eab69c2b187bec85c","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    def stop(self):"},{"line_number":87,"context_line":"        \"\"\"Halt the process and watcher threads.\"\"\""},{"line_number":88,"context_line":"        if self._kill_event:"},{"line_number":89,"context_line":"            LOG.debug(_(\u0027Halting async process [%(cmd)s].\u0027) %"},{"line_number":90,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":91,"context_line":"            self._kill()"},{"line_number":92,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATH%2F%2F%2Bnk%3D","line":89,"in_reply_to":"AAAAS3%2F%2FEIA%3D","updated":"2013-10-07 07:13:13.000000000","message":"Done","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"64b3c432e7abca11a2f96f62517036f45074332f","unresolved":false,"context_lines":[{"line_number":147,"context_line":"    def _handle_process_error(self):"},{"line_number":148,"context_line":"        \"\"\"Kill the async process and respawn if necessary.\"\"\""},{"line_number":149,"context_line":"        LOG.debug("},{"line_number":150,"context_line":"            _(\u0027Halting async process [%(cmd)s] in response to an error.\u0027) %"},{"line_number":151,"context_line":"            {\u0027cmd\u0027: self.cmd})"},{"line_number":152,"context_line":"        respawning \u003d self.respawn_interval \u003e\u003d 0"},{"line_number":153,"context_line":"        self._kill(respawning\u003drespawning)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAS3%2F%2FEH8%3D","line":150,"updated":"2013-10-05 04:02:14.000000000","message":"minor: % -\u003e \u0027,\u0027","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0e45cb7ebe6f609ebaa8dd0eab69c2b187bec85c","unresolved":false,"context_lines":[{"line_number":147,"context_line":"    def _handle_process_error(self):"},{"line_number":148,"context_line":"        \"\"\"Kill the async process and respawn if necessary.\"\"\""},{"line_number":149,"context_line":"        LOG.debug("},{"line_number":150,"context_line":"            _(\u0027Halting async process [%(cmd)s] in response to an error.\u0027) %"},{"line_number":151,"context_line":"            {\u0027cmd\u0027: self.cmd})"},{"line_number":152,"context_line":"        respawning \u003d self.respawn_interval \u003e\u003d 0"},{"line_number":153,"context_line":"        self._kill(respawning\u003drespawning)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATH%2F%2F%2Bng%3D","line":150,"in_reply_to":"AAAAS3%2F%2FEH8%3D","updated":"2013-10-07 07:13:13.000000000","message":"Done","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"64b3c432e7abca11a2f96f62517036f45074332f","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        self._kill(respawning\u003drespawning)"},{"line_number":154,"context_line":"        if respawning:"},{"line_number":155,"context_line":"            eventlet.sleep(self.respawn_interval)"},{"line_number":156,"context_line":"            LOG.debug(_(\u0027Respawning async process [%(cmd)s.\u0027) %"},{"line_number":157,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":158,"context_line":"            self._spawn()"},{"line_number":159,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAS3%2F%2FEH4%3D","line":156,"updated":"2013-10-05 04:02:14.000000000","message":"ditto\n\nand seems missing a close \u0027]\u0027","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0e45cb7ebe6f609ebaa8dd0eab69c2b187bec85c","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        self._kill(respawning\u003drespawning)"},{"line_number":154,"context_line":"        if respawning:"},{"line_number":155,"context_line":"            eventlet.sleep(self.respawn_interval)"},{"line_number":156,"context_line":"            LOG.debug(_(\u0027Respawning async process [%(cmd)s.\u0027) %"},{"line_number":157,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":158,"context_line":"            self._spawn()"},{"line_number":159,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATH%2F%2F%2Bnc%3D","line":156,"in_reply_to":"AAAAS3%2F%2FEH4%3D","updated":"2013-10-07 07:13:13.000000000","message":"Done","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"64b3c432e7abca11a2f96f62517036f45074332f","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                    break"},{"line_number":165,"context_line":"            except Exception:"},{"line_number":166,"context_line":"                LOG.exception(_(\u0027An error occured while communicating \u0027"},{"line_number":167,"context_line":"                                \u0027with async process [%(cmd)s].\u0027) %"},{"line_number":168,"context_line":"                              {\u0027cmd\u0027: self.cmd})"},{"line_number":169,"context_line":"                break"},{"line_number":170,"context_line":"            # Ensure that watching a process with lots of output does"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAS3%2F%2FEH0%3D","line":167,"updated":"2013-10-05 04:02:14.000000000","message":"ditto","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0e45cb7ebe6f609ebaa8dd0eab69c2b187bec85c","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                    break"},{"line_number":165,"context_line":"            except Exception:"},{"line_number":166,"context_line":"                LOG.exception(_(\u0027An error occured while communicating \u0027"},{"line_number":167,"context_line":"                                \u0027with async process [%(cmd)s].\u0027) %"},{"line_number":168,"context_line":"                              {\u0027cmd\u0027: self.cmd})"},{"line_number":169,"context_line":"                break"},{"line_number":170,"context_line":"            # Ensure that watching a process with lots of output does"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATH%2F%2F%2BnY%3D","line":167,"in_reply_to":"AAAAS3%2F%2FEH0%3D","updated":"2013-10-07 07:13:13.000000000","message":"Done","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ab29bcbe4f564fe67b9e72aca2bb813d2a1cc02e","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":81,"context_line":"        else:"},{"line_number":82,"context_line":"            LOG.debug(_(\u0027Launching async process [%(cmd)s].\u0027),"},{"line_number":83,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":84,"context_line":"            self._spawn()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def stop(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATH%2F%2F%2BjI%3D","line":83,"updated":"2013-10-07 07:48:55.000000000","message":"Nit: There is one substitution. %s is recommended in the convention. It applies throughout the code.","commit_id":"5d85fd8b84e9718c9956ba55770c7fd7afcbdc54"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"04eafcbd020fdb87f3f77934f924e7fb1a407a20","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            raise AsyncProcessException(_(\u0027Process is already started\u0027))"},{"line_number":81,"context_line":"        else:"},{"line_number":82,"context_line":"            LOG.debug(_(\u0027Launching async process [%(cmd)s].\u0027),"},{"line_number":83,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":84,"context_line":"            self._spawn()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def stop(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATH%2F%2F7oU%3D","line":83,"in_reply_to":"AAAATH%2F%2F%2BjI%3D","updated":"2013-10-07 22:09:29.000000000","message":"Done","commit_id":"5d85fd8b84e9718c9956ba55770c7fd7afcbdc54"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ab29bcbe4f564fe67b9e72aca2bb813d2a1cc02e","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":158,"context_line":"            self._spawn()"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _watch_process(self, callback, kill_event):"},{"line_number":161,"context_line":"        while not kill_event.ready():"},{"line_number":162,"context_line":"            try:"},{"line_number":163,"context_line":"                if not callback():"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATH%2F%2F%2BaU%3D","line":160,"updated":"2013-10-07 07:48:55.000000000","message":"Nit: This method watches a process specified by this arg, so \"kill_event\" sounds a bit odd. I prefer \"watch_event\" as the third argument name.\n\nThere may be a better word for \"self._kill_event\" too.","commit_id":"5d85fd8b84e9718c9956ba55770c7fd7afcbdc54"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"04eafcbd020fdb87f3f77934f924e7fb1a407a20","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":158,"context_line":"            self._spawn()"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _watch_process(self, callback, kill_event):"},{"line_number":161,"context_line":"        while not kill_event.ready():"},{"line_number":162,"context_line":"            try:"},{"line_number":163,"context_line":"                if not callback():"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATH%2F%2F7oY%3D","line":160,"in_reply_to":"AAAATH%2F%2F%2BaU%3D","updated":"2013-10-07 22:09:29.000000000","message":"I\u0027m afraid I don\u0027t understand your objection.  If either of process death or an explicit stop() call is made, the kill event is triggered and will ensure that the process is cleaned up to the best of the class\u0027 ability.  It is not strictly a function of the _watch_process method.  Maybe you would like to find me on irc and you can explain your position further.","commit_id":"5d85fd8b84e9718c9956ba55770c7fd7afcbdc54"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"776ccb6b5f95f31c5e00b8029500ead5110a76f1","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                      {\u0027cmd\u0027: self.cmd})"},{"line_number":158,"context_line":"            self._spawn()"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _watch_process(self, callback, kill_event):"},{"line_number":161,"context_line":"        while not kill_event.ready():"},{"line_number":162,"context_line":"            try:"},{"line_number":163,"context_line":"                if not callback():"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATH%2F%2FjZk%3D","line":160,"in_reply_to":"AAAATH%2F%2F7oY%3D","updated":"2013-10-14 16:08:46.000000000","message":"Sorry for my late response. You are right.\n\nIt seems I was confused. I read the code and confirmed \"kill_event\" is used only to notify the main process is killed. I misunderstood that \"kill_event\" is a process _watch_process should watch.","commit_id":"5d85fd8b84e9718c9956ba55770c7fd7afcbdc54"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7dbbac341dfb3a2a5525f3b172258ea7455de2c6","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    that can be read via repeatedly calling iter_stdout() and"},{"line_number":39,"context_line":"    iter_stderr()."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    If respawn_interval is non-zero, any error in communicating with"},{"line_number":42,"context_line":"    the managed process will result in the process and greenthreads"},{"line_number":43,"context_line":"    being cleaned up and the process restarted after the specified"},{"line_number":44,"context_line":"    interval."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2Fv%2FI%3D","line":41,"updated":"2013-10-10 12:45:41.000000000","message":"If I understand the code correctly, it will be respawned even when respawn_interval is 0","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"db46032f981101dff6a48387090ba62bde4bde02","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    that can be read via repeatedly calling iter_stdout() and"},{"line_number":39,"context_line":"    iter_stderr()."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    If respawn_interval is non-zero, any error in communicating with"},{"line_number":42,"context_line":"    the managed process will result in the process and greenthreads"},{"line_number":43,"context_line":"    being cleaned up and the process restarted after the specified"},{"line_number":44,"context_line":"    interval."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FtLc%3D","line":41,"in_reply_to":"AAAATH%2F%2Fv%2FI%3D","updated":"2013-10-10 22:59:41.000000000","message":"Correct.  If the respawn interval is zero, the respawn will happen without delay.","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7dbbac341dfb3a2a5525f3b172258ea7455de2c6","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        \"\"\""},{"line_number":66,"context_line":"        self.cmd \u003d cmd"},{"line_number":67,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":68,"context_line":"        if respawn_interval is not None and respawn_interval \u003c 0:"},{"line_number":69,"context_line":"            raise ValueError(_(\u0027respawn_interval must be \u003e\u003d 0 if provided.\u0027))"},{"line_number":70,"context_line":"        self.respawn_interval \u003d respawn_interval"},{"line_number":71,"context_line":"        self._process \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2Fvi0%3D","line":68,"updated":"2013-10-10 12:45:41.000000000","message":"Just a question:\nWhy is this checked explicitly? If someone passes negative number as a parameter then line 149 will be evaluated as False, hence no respawning will happen. Even if negative number would be passed to eventlet.sleep() it yields.\n\nOr is this a general check for all kind of objects that someone can pass?","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"7f9be00c5a74a6c0771f2c2fdb042634ec74ee79","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        \"\"\""},{"line_number":66,"context_line":"        self.cmd \u003d cmd"},{"line_number":67,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":68,"context_line":"        if respawn_interval is not None and respawn_interval \u003c 0:"},{"line_number":69,"context_line":"            raise ValueError(_(\u0027respawn_interval must be \u003e\u003d 0 if provided.\u0027))"},{"line_number":70,"context_line":"        self.respawn_interval \u003d respawn_interval"},{"line_number":71,"context_line":"        self._process \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FraU%3D","line":68,"in_reply_to":"AAAATH%2F%2FtLU%3D","updated":"2013-10-11 10:49:10.000000000","message":"sorry to be the one who always come us with boring comments!","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"db46032f981101dff6a48387090ba62bde4bde02","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        \"\"\""},{"line_number":66,"context_line":"        self.cmd \u003d cmd"},{"line_number":67,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":68,"context_line":"        if respawn_interval is not None and respawn_interval \u003c 0:"},{"line_number":69,"context_line":"            raise ValueError(_(\u0027respawn_interval must be \u003e\u003d 0 if provided.\u0027))"},{"line_number":70,"context_line":"        self.respawn_interval \u003d respawn_interval"},{"line_number":71,"context_line":"        self._process \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FtLU%3D","line":68,"in_reply_to":"AAAATH%2F%2Fvi0%3D","updated":"2013-10-10 22:59:41.000000000","message":"I was being explicit in response to a review comment from Salvatore.  It\u0027s not really necessary except as a convenience - a negative number really doesn\u0027t make sense as a sleep interval regardless of eventlet\u0027s support for it.","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"12949496a412577c3785928ea9af134980846d66","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        # as a zombie, so the only way to ensure that both die is to"},{"line_number":134,"context_line":"        # kill the child process directly."},{"line_number":135,"context_line":"        if self.root_helper:"},{"line_number":136,"context_line":"            child_pids \u003d utils.find_child_pids(pid)"},{"line_number":137,"context_line":"            for child_pid in child_pids:"},{"line_number":138,"context_line":"                # A process started by a root helper will be running"},{"line_number":139,"context_line":"                # as root and need to be killed via the same helper."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FtNI%3D","line":136,"updated":"2013-10-10 22:37:04.000000000","message":"question: between here and line 140 there might be a chance that the child process might have died. Isn\u0027t it better to wrap kill into a try-catch? Or are we certain that the pid hasn\u0027t become stale or that the kill succeeds?","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"b2d3a87af7639dbf65e8ad9fdddab9f8cf5f780f","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        # as a zombie, so the only way to ensure that both die is to"},{"line_number":134,"context_line":"        # kill the child process directly."},{"line_number":135,"context_line":"        if self.root_helper:"},{"line_number":136,"context_line":"            child_pids \u003d utils.find_child_pids(pid)"},{"line_number":137,"context_line":"            for child_pid in child_pids:"},{"line_number":138,"context_line":"                # A process started by a root helper will be running"},{"line_number":139,"context_line":"                # as root and need to be killed via the same helper."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FmyA%3D","line":136,"in_reply_to":"AAAATH%2F%2Fs7U%3D","updated":"2013-10-13 14:04:00.000000000","message":"You are absolutely correct, my apologies.  And relying on utils.execute to log the error is problematic anyway, since logging is only at the debug level.  I\u0027ll submit an updated patch.","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"75f288aebd101157e5cdb3b12e88c26c6a41a7b6","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        # as a zombie, so the only way to ensure that both die is to"},{"line_number":134,"context_line":"        # kill the child process directly."},{"line_number":135,"context_line":"        if self.root_helper:"},{"line_number":136,"context_line":"            child_pids \u003d utils.find_child_pids(pid)"},{"line_number":137,"context_line":"            for child_pid in child_pids:"},{"line_number":138,"context_line":"                # A process started by a root helper will be running"},{"line_number":139,"context_line":"                # as root and need to be killed via the same helper."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2Fs7U%3D","line":136,"in_reply_to":"AAAATH%2F%2FtH8%3D","updated":"2013-10-11 00:12:28.000000000","message":"from what I can tell, killing -9 on an invalid pid returns 1 as exit status and utils.execute raises a RuntimeError, being check_existcode True by default. Am I barking at the wrong tree?","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"db46032f981101dff6a48387090ba62bde4bde02","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        # as a zombie, so the only way to ensure that both die is to"},{"line_number":134,"context_line":"        # kill the child process directly."},{"line_number":135,"context_line":"        if self.root_helper:"},{"line_number":136,"context_line":"            child_pids \u003d utils.find_child_pids(pid)"},{"line_number":137,"context_line":"            for child_pid in child_pids:"},{"line_number":138,"context_line":"                # A process started by a root helper will be running"},{"line_number":139,"context_line":"                # as root and need to be killed via the same helper."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FtH8%3D","line":136,"in_reply_to":"AAAATH%2F%2FtNI%3D","updated":"2013-10-10 22:59:41.000000000","message":"I\u0027m afraid I\u0027m relying on the neutron default of having utils.execute() log errors rather than raise them.  There isn\u0027t much special handling that can be done in this case, at least not by a general-purpose class such as this.  Subclasses can always override if they know how to better handle a specific process\u0027s lifecycle.","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"}],"neutron/agent/linux/utils.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        if no_children_found:"},{"line_number":113,"context_line":"            return []"},{"line_number":114,"context_line":"        # Unexpected errors are the responsibility of the caller"},{"line_number":115,"context_line":"        raise"},{"line_number":116,"context_line":"    if raw_pids:"},{"line_number":117,"context_line":"        return [x.strip() for x in raw_pids.split(\u0027\\n\u0027) if x.strip()]"},{"line_number":118,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2Fzbw%3D","line":115,"updated":"2013-09-18 22:59:22.000000000","message":"I reckong the code in the except block is safe, so in my opinion there is no need to ask for using excutils.save_and_reraise_exception","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        # Unexpected errors are the responsibility of the caller"},{"line_number":115,"context_line":"        raise"},{"line_number":116,"context_line":"    if raw_pids:"},{"line_number":117,"context_line":"        return [x.strip() for x in raw_pids.split(\u0027\\n\u0027) if x.strip()]"},{"line_number":118,"context_line":"    else:"},{"line_number":119,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2Fzbk%3D","line":117,"updated":"2013-09-18 22:59:22.000000000","message":"would it be possible to kust move the above line after line 108 this avoiding this if statement?\n\nOf course ignore this if execute might not raise and return None.","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        # Unexpected errors are the responsibility of the caller"},{"line_number":115,"context_line":"        raise"},{"line_number":116,"context_line":"    if raw_pids:"},{"line_number":117,"context_line":"        return [x.strip() for x in raw_pids.split(\u0027\\n\u0027) if x.strip()]"},{"line_number":118,"context_line":"    else:"},{"line_number":119,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FYg4%3D","line":117,"in_reply_to":"AAAAS3%2F%2Fzbk%3D","updated":"2013-09-27 18:50:33.000000000","message":"I try to minimize the scope of try blocks as much as possible, so I\u0027d rather not move line 117.  However, you are correct that execute will never return None, so I\u0027ve removed the conditional block entirely.","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"7e8d7acf4023bef9134b6ac96e1c4816de7d7ad7","unresolved":false,"context_lines":[{"line_number":113,"context_line":"def find_child_pids(pid):"},{"line_number":114,"context_line":"    \"\"\"Retrieve a list of the pids of child processes of the given pid.\"\"\""},{"line_number":115,"context_line":"    try:"},{"line_number":116,"context_line":"        raw_pids \u003d execute([\u0027ps\u0027, \u0027--ppid\u0027, pid, \u0027-o\u0027, \u0027pid\u003d\u0027])"},{"line_number":117,"context_line":"    except RuntimeError as e:"},{"line_number":118,"context_line":"        # Exception has already been logged by execute"},{"line_number":119,"context_line":"        no_children_found \u003d \u0027Exit code: 1\u0027 in str(e)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATH%2F%2FiDU%3D","line":116,"updated":"2013-10-14 22:03:18.000000000","message":"It is an added dependency (though one that is packaged in Ubuntu, Fedora, and RHEL), but this could be simplified by using python-psutils. https://code.google.com/p/psutil/\n\nBasically just:\n  return psutils.Process(pid).get_children()\nunless you want to hide NoSuchProcess errors and do:\n\ntry:\n  p \u003d psutils.Process(pid)\nexcept psutils.NoSuchProcess:\n  return []\nreturn p.get_children()\n\nNot sure if you think it is worth adding a dependency, but psutils is very portable, it avoids parsing human-readable output., and makes using mock unnecessary for testing.","commit_id":"acf0209b28e21eed60158967fab77468eb195e7c"}],"neutron/tests/unit/agent/linux/test_async_process.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"042c5db005f1ae0d8958bd86f9690d0b95187068","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        super(TestAsyncProcess, self).setUp()"},{"line_number":32,"context_line":"        self.proc \u003d async_process.AsyncProcess([\u0027fake\u0027])"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def test__spawn(self):"},{"line_number":35,"context_line":"        expected_process \u003d \u0027Foo\u0027"},{"line_number":36,"context_line":"        proc \u003d self.proc"},{"line_number":37,"context_line":"        with mock.patch.object(utils, \u0027create_process\u0027) as mock_create_process:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FzbQ%3D","line":34,"updated":"2013-09-18 22:59:22.000000000","message":"innocent question: what is the rationale for the sintax with the double underscore?","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6a76d982f6c69df310319cbde5f833c7a5ee27eb","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        super(TestAsyncProcess, self).setUp()"},{"line_number":32,"context_line":"        self.proc \u003d async_process.AsyncProcess([\u0027fake\u0027])"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def test__spawn(self):"},{"line_number":35,"context_line":"        expected_process \u003d \u0027Foo\u0027"},{"line_number":36,"context_line":"        proc \u003d self.proc"},{"line_number":37,"context_line":"        with mock.patch.object(utils, \u0027create_process\u0027) as mock_create_process:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FarU%3D","line":34,"in_reply_to":"AAAAS3%2F%2FzbQ%3D","updated":"2013-09-27 18:50:33.000000000","message":"My habit is to prefix the method under test with test_.  Since the method is _spawn, the test name is test__spawn.  Consistency is the hobgoblin of...what?","commit_id":"0211a7bf6ce561aee4b2e63eb740d5d2e0911857"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"64b3c432e7abca11a2f96f62517036f45074332f","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        with testtools.ExpectedException(ValueError):"},{"line_number":36,"context_line":"            async_process.AsyncProcess([\u0027fake\u0027], respawn_interval\u003d-1)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def test__spawn(self):"},{"line_number":39,"context_line":"        expected_process \u003d \u0027Foo\u0027"},{"line_number":40,"context_line":"        proc \u003d self.proc"},{"line_number":41,"context_line":"        with mock.patch.object(utils, \u0027create_process\u0027) as mock_create_process:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAS3%2F%2FEHw%3D","line":38,"updated":"2013-10-05 04:02:14.000000000","message":"does the double underscores intend to specify for test_  _spawn? but i still think it is strange","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0e45cb7ebe6f609ebaa8dd0eab69c2b187bec85c","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        with testtools.ExpectedException(ValueError):"},{"line_number":36,"context_line":"            async_process.AsyncProcess([\u0027fake\u0027], respawn_interval\u003d-1)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def test__spawn(self):"},{"line_number":39,"context_line":"        expected_process \u003d \u0027Foo\u0027"},{"line_number":40,"context_line":"        proc \u003d self.proc"},{"line_number":41,"context_line":"        with mock.patch.object(utils, \u0027create_process\u0027) as mock_create_process:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATH%2F%2F%2BnU%3D","line":38,"in_reply_to":"AAAAS3%2F%2FEHw%3D","updated":"2013-10-07 07:13:13.000000000","message":"My presumption is that test_ always prefixes the method name.","commit_id":"3186776b84179406667dd52c3405d50c61474a16"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7dbbac341dfb3a2a5525f3b172258ea7455de2c6","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            self.assertEqual(output, result)"},{"line_number":108,"context_line":"            self.assertEqual(output, queue.get_nowait())"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            self.assertFalse(result)"},{"line_number":111,"context_line":"            self.assertTrue(queue.empty())"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test__read_queues_and_returns_output(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FvyM%3D","line":110,"updated":"2013-10-10 12:45:41.000000000","message":"Wouldn\u0027t be more precise?:\n\n self.assertEqual(result, str())","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"b2d3a87af7639dbf65e8ad9fdddab9f8cf5f780f","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            self.assertEqual(output, result)"},{"line_number":108,"context_line":"            self.assertEqual(output, queue.get_nowait())"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            self.assertFalse(result)"},{"line_number":111,"context_line":"            self.assertTrue(queue.empty())"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test__read_queues_and_returns_output(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2Fmx4%3D","line":110,"in_reply_to":"AAAATH%2F%2FuXc%3D","updated":"2013-10-13 14:04:00.000000000","message":"Done","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"9b5a3e7510bd1206082b5d7c9a35cf0208dd0418","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            self.assertEqual(output, result)"},{"line_number":108,"context_line":"            self.assertEqual(output, queue.get_nowait())"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            self.assertFalse(result)"},{"line_number":111,"context_line":"            self.assertTrue(queue.empty())"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test__read_queues_and_returns_output(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FuXc%3D","line":110,"in_reply_to":"AAAATH%2F%2FvyM%3D","updated":"2013-10-10 17:04:15.000000000","message":"self.assertIsNone would be more precise - the _read() method only returns a value if non-empty strings are provided.","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7dbbac341dfb3a2a5525f3b172258ea7455de2c6","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        expected_value \u003d \u0027foo\u0027"},{"line_number":142,"context_line":"        with mock.patch.object(self.proc, \u0027_iter_queue\u0027) as mock_iter_queue:"},{"line_number":143,"context_line":"            mock_iter_queue.return_value \u003d expected_value"},{"line_number":144,"context_line":"            target_func \u003d getattr(self.proc, \u0027iter_%s\u0027 % output_type, None)"},{"line_number":145,"context_line":"            value \u003d target_func()"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        self.assertEqual(value, expected_value)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2Fvpc%3D","line":144,"updated":"2013-10-10 12:45:41.000000000","message":"Is None needed here? If attribute .iter_something doesn\u0027t exist, exception would be raised on the following line anyway, wouldn\u0027t it?","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"b2d3a87af7639dbf65e8ad9fdddab9f8cf5f780f","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        expected_value \u003d \u0027foo\u0027"},{"line_number":142,"context_line":"        with mock.patch.object(self.proc, \u0027_iter_queue\u0027) as mock_iter_queue:"},{"line_number":143,"context_line":"            mock_iter_queue.return_value \u003d expected_value"},{"line_number":144,"context_line":"            target_func \u003d getattr(self.proc, \u0027iter_%s\u0027 % output_type, None)"},{"line_number":145,"context_line":"            value \u003d target_func()"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        self.assertEqual(value, expected_value)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2Fmx8%3D","line":144,"in_reply_to":"AAAATH%2F%2FooY%3D","updated":"2013-10-13 14:04:00.000000000","message":"*sigh* I thought I\u0027d checked getattr without a default and it worked but clearly I wasn\u0027t paying attention.","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"b35b993c501c7ebb4bc7070019e9eb0002992c9e","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        expected_value \u003d \u0027foo\u0027"},{"line_number":142,"context_line":"        with mock.patch.object(self.proc, \u0027_iter_queue\u0027) as mock_iter_queue:"},{"line_number":143,"context_line":"            mock_iter_queue.return_value \u003d expected_value"},{"line_number":144,"context_line":"            target_func \u003d getattr(self.proc, \u0027iter_%s\u0027 % output_type, None)"},{"line_number":145,"context_line":"            value \u003d target_func()"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        self.assertEqual(value, expected_value)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FooY%3D","line":144,"in_reply_to":"AAAATH%2F%2FtGs%3D","updated":"2013-10-12 00:12:59.000000000","message":"None is required as the third parameter.  (.get() on a dict is the optional one).","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"db46032f981101dff6a48387090ba62bde4bde02","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        expected_value \u003d \u0027foo\u0027"},{"line_number":142,"context_line":"        with mock.patch.object(self.proc, \u0027_iter_queue\u0027) as mock_iter_queue:"},{"line_number":143,"context_line":"            mock_iter_queue.return_value \u003d expected_value"},{"line_number":144,"context_line":"            target_func \u003d getattr(self.proc, \u0027iter_%s\u0027 % output_type, None)"},{"line_number":145,"context_line":"            value \u003d target_func()"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        self.assertEqual(value, expected_value)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FtGs%3D","line":144,"in_reply_to":"AAAATH%2F%2Fvpc%3D","updated":"2013-10-10 22:59:41.000000000","message":"You\u0027re right - it\u0027s not needed.  I was under the mistaken impression that the default value parameter was required by getattr.","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"12949496a412577c3785928ea9af134980846d66","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        with mock.patch.object(self.proc, \u0027_process\u0027) as mock_process:"},{"line_number":179,"context_line":"            with mock.patch.object(mock_process, \u0027pid\u0027) as mock_pid:"},{"line_number":180,"context_line":"                with mock.patch.object(utils, \u0027find_child_pids\u0027,"},{"line_number":181,"context_line":"                                       return_value\u003d[\u00271\u0027]) as mock_find_pids:"},{"line_number":182,"context_line":"                    with mock.patch.object(utils, \u0027execute\u0027) as mock_execute:"},{"line_number":183,"context_line":"                        self.proc._kill_process()"},{"line_number":184,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FtMA%3D","line":181,"updated":"2013-10-10 22:37:04.000000000","message":"how about testing multiple pids or no pids?","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"75f288aebd101157e5cdb3b12e88c26c6a41a7b6","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        with mock.patch.object(self.proc, \u0027_process\u0027) as mock_process:"},{"line_number":179,"context_line":"            with mock.patch.object(mock_process, \u0027pid\u0027) as mock_pid:"},{"line_number":180,"context_line":"                with mock.patch.object(utils, \u0027find_child_pids\u0027,"},{"line_number":181,"context_line":"                                       return_value\u003d[\u00271\u0027]) as mock_find_pids:"},{"line_number":182,"context_line":"                    with mock.patch.object(utils, \u0027execute\u0027) as mock_execute:"},{"line_number":183,"context_line":"                        self.proc._kill_process()"},{"line_number":184,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2Fs60%3D","line":181,"in_reply_to":"AAAATH%2F%2FtHM%3D","updated":"2013-10-11 00:12:28.000000000","message":"fair enough","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"db46032f981101dff6a48387090ba62bde4bde02","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        with mock.patch.object(self.proc, \u0027_process\u0027) as mock_process:"},{"line_number":179,"context_line":"            with mock.patch.object(mock_process, \u0027pid\u0027) as mock_pid:"},{"line_number":180,"context_line":"                with mock.patch.object(utils, \u0027find_child_pids\u0027,"},{"line_number":181,"context_line":"                                       return_value\u003d[\u00271\u0027]) as mock_find_pids:"},{"line_number":182,"context_line":"                    with mock.patch.object(utils, \u0027execute\u0027) as mock_execute:"},{"line_number":183,"context_line":"                        self.proc._kill_process()"},{"line_number":184,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATH%2F%2FtHM%3D","line":181,"in_reply_to":"AAAATH%2F%2FtMA%3D","updated":"2013-10-10 22:59:41.000000000","message":"I\u0027m looking at the code from a whitebox perspective - this is a unit test after all.  I know the only usage of the list is to iterate, and I know that the loop will not be invoked in the case of no pids, and that it will be invoked once more for each additional pid.  If and when someone modifies the code to add special cases for 0 or n pids, they are responsible for adding test code to ensure proper coverage.","commit_id":"3f1c9cf0d27521b7bbf9548e1f157243e753f150"}]}
