)]}'
{"monasca_agent/collector/checks/collector.py":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"76ed61602861b212157c8dac7eb02487dd8e186a","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        # in which case we\u0027ll get a misleading error in the logs."},{"line_number":276,"context_line":"        # Best to not even try."},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        log.info(\"stopping the collector with timeout %d seconds\" % timeout)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        self.continue_running \u003d False"},{"line_number":281,"context_line":"        for check_name in self.collection_times:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_1cce415a","line":278,"updated":"2017-01-27 09:46:05.000000000","message":"I think that, assuming your change only comes in place if timeout \u003e 0, maybe this could be logged only if timeout \u003e 0","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"31ceb420bdb90102bf02acaa943c28f44b7d4c17","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        # in which case we\u0027ll get a misleading error in the logs."},{"line_number":276,"context_line":"        # Best to not even try."},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        log.info(\"stopping the collector with timeout %d seconds\" % timeout)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        self.continue_running \u003d False"},{"line_number":281,"context_line":"        for check_name in self.collection_times:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_7298f7c0","line":278,"in_reply_to":"3a461143_1cce415a","updated":"2017-01-30 21:43:31.000000000","message":"I prefer to log it even when timeout is zero so it is clear that the collector is being stopped and it is not going to wait for the worker to stop.","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"6277d57783e7443fe7717f27f9101314b4cb72f6","unresolved":false,"context_lines":[{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        for worker in self.pool._pool:"},{"line_number":308,"context_line":"            if worker.is_alive():"},{"line_number":309,"context_line":"                log.info(\u0027worker %s is still alive when collector stop times outs\u0027 % worker.name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_85f638f7","line":309,"range":{"start_line":309,"start_character":77,"end_line":309,"end_character":81},"updated":"2017-01-27 23:03:59.000000000","message":"out","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"f9be6f194f28984f4319c01a42ac85df4a6a8cdd","unresolved":false,"context_lines":[{"line_number":302,"context_line":"                    try:"},{"line_number":303,"context_line":"                        worker.join(t)"},{"line_number":304,"context_line":"                    except Exception:"},{"line_number":305,"context_line":"                        log.warning(\"Unexpected error:\", sys.exc_info()[0])"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        for worker in self.pool._pool:"},{"line_number":308,"context_line":"            if worker.is_alive():"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_048fa775","line":305,"range":{"start_line":305,"start_character":28,"end_line":305,"end_character":35},"updated":"2017-02-14 00:49:09.000000000","message":"If this is an unexpected error shouldn\u0027t this be a log.error or log.exception?","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"fe12fc9627b655a03ec79af0c5e865d30d430930","unresolved":false,"context_lines":[{"line_number":302,"context_line":"                    try:"},{"line_number":303,"context_line":"                        worker.join(t)"},{"line_number":304,"context_line":"                    except Exception:"},{"line_number":305,"context_line":"                        log.warning(\"Unexpected error:\", sys.exc_info()[0])"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        for worker in self.pool._pool:"},{"line_number":308,"context_line":"            if worker.is_alive():"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_4ee37533","line":305,"range":{"start_line":305,"start_character":28,"end_line":305,"end_character":35},"in_reply_to":"fa31d9ce_048fa775","updated":"2017-02-14 06:52:17.000000000","message":"Agreed.","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"c2fcc03ea08667e8c57439492f9951814c1c269f","unresolved":false,"context_lines":[{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        for worker in self.pool._pool:"},{"line_number":308,"context_line":"            if worker.is_alive():"},{"line_number":309,"context_line":"                log.info(\u0027worker %s is still alive when collector stop times out\u0027 % worker.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_49a29dfe","line":309,"range":{"start_line":309,"start_character":20,"end_line":309,"end_character":24},"updated":"2017-02-13 22:04:54.000000000","message":"At the end of this is a worker being alive still a problem?  Is the process still going to exit properly?","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"f9be6f194f28984f4319c01a42ac85df4a6a8cdd","unresolved":false,"context_lines":[{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        for worker in self.pool._pool:"},{"line_number":308,"context_line":"            if worker.is_alive():"},{"line_number":309,"context_line":"                log.info(\u0027worker %s is still alive when collector stop times out\u0027 % worker.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_24b58b30","line":309,"range":{"start_line":309,"start_character":20,"end_line":309,"end_character":24},"in_reply_to":"fa31d9ce_1430bce7","updated":"2017-02-14 00:49:09.000000000","message":"I think I understand what it\u0027s doing here but it does feel odd to end the function with a log call and then do nothing about the still living workers.  Maybe a comment explaining what\u0027s going to happen to them once the function returns?","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"ec3780c80877bbdc3c3e1ea3013abea8c6756406","unresolved":false,"context_lines":[{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        for worker in self.pool._pool:"},{"line_number":308,"context_line":"            if worker.is_alive():"},{"line_number":309,"context_line":"                log.info(\u0027worker %s is still alive when collector stop times out\u0027 % worker.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_1430bce7","line":309,"range":{"start_line":309,"start_character":20,"end_line":309,"end_character":24},"in_reply_to":"fa31d9ce_49a29dfe","updated":"2017-02-13 22:54:18.000000000","message":"the code goes next to the os._exit call if the worker is still active after the specified timeout. This\u0027d be the same behavior when the user manually stops monasca-agent except that the latter doesn\u0027t have a timeout in place. The agent restart has to continue and exit in the case a worker doesn\u0027t behave (e.g., hang). This is needed to solve the problem that a customer was seeing with vcenter environment.","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"dce515e7df8c41bc7756e4ccfab7dda00fae0c34","unresolved":false,"context_lines":[{"line_number":302,"context_line":"                    try:"},{"line_number":303,"context_line":"                        worker.join(t)"},{"line_number":304,"context_line":"                    except Exception:"},{"line_number":305,"context_line":"                        log.error(\"Unexpected error: \", sys.exc_info()[0])"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        for worker in self.pool._pool:"},{"line_number":308,"context_line":"            if worker.is_alive():"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba2be162_40466424","line":305,"range":{"start_line":305,"start_character":28,"end_line":305,"end_character":33},"updated":"2017-02-28 19:48:44.000000000","message":"I\u0027m not sure what sys.exc_info()[0] provides but we should be able to just use log.exception here to get a reasonable stack trace without having to have the sys call.","commit_id":"f24e722ecda223f00f7bf253f5ed89693cb05ee1"}],"monasca_agent/collector/checks/services_checks.py":[{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"6c49a391f80dc3552469abb56270dadb3cfe9843","unresolved":false,"context_lines":[{"line_number":20,"context_line":"up_down \u003d collections.namedtuple(\u0027up_down\u0027, [\u0027UP\u0027, \u0027DOWN\u0027])"},{"line_number":21,"context_line":"Status \u003d up_down(\u0027UP\u0027, \u0027DOWN\u0027)"},{"line_number":22,"context_line":"EventType \u003d up_down(\"servicecheck.state_change.up\", \"servicecheck.state_change.down\")"},{"line_number":23,"context_line":"monkey.patch_all()"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class ServicesCheck(monasca_agent.collector.checks.AgentCheck):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_2878668f","side":"PARENT","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":18},"updated":"2017-02-01 22:55:53.000000000","message":"I\u0027m pretty sure this is a really important line.  eventlet has a similar monkey patching mechanism that we may need to use here but I\u0027m not sure why we decided to use gevent over eventlet here.","commit_id":"9599bb491248d738535900433761c106daf529c1"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"7bd517fb4ead780945e16baf348f098db826401c","unresolved":false,"context_lines":[{"line_number":20,"context_line":"up_down \u003d collections.namedtuple(\u0027up_down\u0027, [\u0027UP\u0027, \u0027DOWN\u0027])"},{"line_number":21,"context_line":"Status \u003d up_down(\u0027UP\u0027, \u0027DOWN\u0027)"},{"line_number":22,"context_line":"EventType \u003d up_down(\"servicecheck.state_change.up\", \"servicecheck.state_change.down\")"},{"line_number":23,"context_line":"monkey.patch_all()"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class ServicesCheck(monasca_agent.collector.checks.AgentCheck):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_bea9ec26","side":"PARENT","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":18},"in_reply_to":"3a461143_2878668f","updated":"2017-02-02 00:53:03.000000000","message":"yes you are correct. I missed the eventlet.monkey_patch() in the commit.","commit_id":"9599bb491248d738535900433761c106daf529c1"},{"author":{"_account_id":11155,"name":"Ryan Bak","email":"ryan.bak@twcable.com","username":"ryanmbak"},"change_message_id":"82d3979b3948c3b3c3660d084dac15f59858072e","unresolved":false,"context_lines":[{"line_number":4,"context_line":"import Queue"},{"line_number":5,"context_line":"import threading"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"import eventlet"},{"line_number":8,"context_line":"from multiprocessing.dummy import Pool as ThreadPool"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"import monasca_agent.collector.checks"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_b8f720f4","line":7,"updated":"2017-02-02 18:17:57.000000000","message":"This replacement will not work.  eventlet timeouts only work with eventlet\u0027s \"greenthreaded\" code.  gevent and the monkey patch were added to ensure that the threads would timeout regardless of where they were in the code because we saw some checks getting permanently stuck in some cases.","commit_id":"850366e5dbc275449487a8a964989cf20a7bd247"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"763fa173b6795ce50f2b6c96959eb5081179883a","unresolved":false,"context_lines":[{"line_number":4,"context_line":"import Queue"},{"line_number":5,"context_line":"import threading"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"import eventlet"},{"line_number":8,"context_line":"from multiprocessing.dummy import Pool as ThreadPool"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"import monasca_agent.collector.checks"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_7864d848","line":7,"in_reply_to":"3a461143_b8f720f4","updated":"2017-02-02 22:49:18.000000000","message":"oslo uses eventlet. Even if I changes the inspector.py in xenapi to use gevent, eventlet is still brought in by oslo VMware lib. Then during auto restart, the event lib conflicts occurs: \nTraceback (most recent call last):\n  File \"/opt/stack/venv/monasca_agent-20161115T170816Z/lib/python2.7/site-packages/eventlet/hubs/hub.py\", line 457, in fire_timers\n    timer()\n  File \"/opt/stack/venv/monasca_agent-20161115T170816Z/lib/python2.7/site-packages/eventlet/hubs/timer.py\", line 58, in __call__\n    cb(*args, **kw)\n  File \"/opt/stack/venv/monasca_agent-20161115T170816Z/lib/python2.7/site-packages/eventlet/event.py\", line 168, in _do_send\n    waiter.switch(result)\n  File \"/opt/stack/venv/monasca_agent-20161115T170816Z/lib/python2.7/site-packages/gevent/greenlet.py\", line 538, in run\n    self._report_result(result)\n  File \"/opt/stack/venv/monasca_agent-20161115T170816Z/lib/python2.7/site-packages/gevent/greenlet.py\", line 511, in _report_result\n    self._notifier \u003d self.parent.loop.run_callback(self._notify_links)\nAttributeError: \u0027greenlet.greenlet\u0027 object has no attribute \u0027loop\u0027","commit_id":"850366e5dbc275449487a8a964989cf20a7bd247"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"c2fcc03ea08667e8c57439492f9951814c1c269f","unresolved":false,"context_lines":[{"line_number":20,"context_line":"up_down \u003d collections.namedtuple(\u0027up_down\u0027, [\u0027UP\u0027, \u0027DOWN\u0027])"},{"line_number":21,"context_line":"Status \u003d up_down(\u0027UP\u0027, \u0027DOWN\u0027)"},{"line_number":22,"context_line":"EventType \u003d up_down(\"servicecheck.state_change.up\", \"servicecheck.state_change.down\")"},{"line_number":23,"context_line":"monkey.patch_all()"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class ServicesCheck(monasca_agent.collector.checks.AgentCheck):"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_297649a4","side":"PARENT","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":18},"updated":"2017-02-13 22:04:54.000000000","message":"Is it necessary to still use the eventlet monkey patch here?","commit_id":"9599bb491248d738535900433761c106daf529c1"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"ec3780c80877bbdc3c3e1ea3013abea8c6756406","unresolved":false,"context_lines":[{"line_number":20,"context_line":"up_down \u003d collections.namedtuple(\u0027up_down\u0027, [\u0027UP\u0027, \u0027DOWN\u0027])"},{"line_number":21,"context_line":"Status \u003d up_down(\u0027UP\u0027, \u0027DOWN\u0027)"},{"line_number":22,"context_line":"EventType \u003d up_down(\"servicecheck.state_change.up\", \"servicecheck.state_change.down\")"},{"line_number":23,"context_line":"monkey.patch_all()"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class ServicesCheck(monasca_agent.collector.checks.AgentCheck):"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_d46704e7","side":"PARENT","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":18},"in_reply_to":"fa31d9ce_297649a4","updated":"2017-02-13 22:54:18.000000000","message":"No, monkey patch is not needed. we only need to green thread the time using \"from eventlet.green import time\". I would like to be more selective to reduce the impact of monkey patch everything.","commit_id":"9599bb491248d738535900433761c106daf529c1"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"c2fcc03ea08667e8c57439492f9951814c1c269f","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        # parameter in the init_config of the check"},{"line_number":58,"context_line":"        try:"},{"line_number":59,"context_line":"            default_size \u003d min(self.instance_count(), multiprocessing.cpu_count() + 1)"},{"line_number":60,"context_line":"        except NotImplementedError:"},{"line_number":61,"context_line":"            default_size \u003d min(self.instance_count(), 6)"},{"line_number":62,"context_line":"        self.pool_size \u003d int(self.init_config.get(\u0027threads_count\u0027, default_size))"},{"line_number":63,"context_line":"        self.timeout \u003d int(self.agent_config.get(\u0027timeout\u0027, DEFAULT_TIMEOUT))"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_4e1f036c","line":60,"range":{"start_line":60,"start_character":15,"end_line":60,"end_character":34},"updated":"2017-02-13 22:04:54.000000000","message":"In this case what are we hitting that may not be implemented?","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"ec3780c80877bbdc3c3e1ea3013abea8c6756406","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        # parameter in the init_config of the check"},{"line_number":58,"context_line":"        try:"},{"line_number":59,"context_line":"            default_size \u003d min(self.instance_count(), multiprocessing.cpu_count() + 1)"},{"line_number":60,"context_line":"        except NotImplementedError:"},{"line_number":61,"context_line":"            default_size \u003d min(self.instance_count(), 6)"},{"line_number":62,"context_line":"        self.pool_size \u003d int(self.init_config.get(\u0027threads_count\u0027, default_size))"},{"line_number":63,"context_line":"        self.timeout \u003d int(self.agent_config.get(\u0027timeout\u0027, DEFAULT_TIMEOUT))"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_947f4c65","line":60,"range":{"start_line":60,"start_character":15,"end_line":60,"end_character":34},"in_reply_to":"fa31d9ce_4e1f036c","updated":"2017-02-13 22:54:18.000000000","message":"This is a standard practice/example to catch the notimplemented error when using multiprocessing.cpu_coount(). I do not know which OS is not supported, but in the case, we would fall back to original implementation of default fixed size.","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"c2fcc03ea08667e8c57439492f9951814c1c269f","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        try:"},{"line_number":59,"context_line":"            default_size \u003d min(self.instance_count(), multiprocessing.cpu_count() + 1)"},{"line_number":60,"context_line":"        except NotImplementedError:"},{"line_number":61,"context_line":"            default_size \u003d min(self.instance_count(), 6)"},{"line_number":62,"context_line":"        self.pool_size \u003d int(self.init_config.get(\u0027threads_count\u0027, default_size))"},{"line_number":63,"context_line":"        self.timeout \u003d int(self.agent_config.get(\u0027timeout\u0027, DEFAULT_TIMEOUT))"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_6e10475a","line":61,"range":{"start_line":61,"start_character":54,"end_line":61,"end_character":55},"updated":"2017-02-13 22:04:54.000000000","message":"Why not keep the DEFAULT_POOL_SIZE variable?","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"ec3780c80877bbdc3c3e1ea3013abea8c6756406","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        try:"},{"line_number":59,"context_line":"            default_size \u003d min(self.instance_count(), multiprocessing.cpu_count() + 1)"},{"line_number":60,"context_line":"        except NotImplementedError:"},{"line_number":61,"context_line":"            default_size \u003d min(self.instance_count(), 6)"},{"line_number":62,"context_line":"        self.pool_size \u003d int(self.init_config.get(\u0027threads_count\u0027, default_size))"},{"line_number":63,"context_line":"        self.timeout \u003d int(self.agent_config.get(\u0027timeout\u0027, DEFAULT_TIMEOUT))"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_54f074fe","line":61,"range":{"start_line":61,"start_character":54,"end_line":61,"end_character":55},"in_reply_to":"fa31d9ce_6e10475a","updated":"2017-02-13 22:54:18.000000000","message":"yes should have.","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"c2fcc03ea08667e8c57439492f9951814c1c269f","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        finally:"},{"line_number":115,"context_line":"            del self.running_jobs[name]"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def _process_result(self, status, msg, name, queue_instance):"},{"line_number":118,"context_line":"        if name not in self.statuses:"},{"line_number":119,"context_line":"            self.statuses[name] \u003d []"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_69076118","line":117,"range":{"start_line":117,"start_character":8,"end_line":117,"end_character":23},"updated":"2017-02-13 22:04:54.000000000","message":"This function stopped dealing with failure conditions.  Does it still have to?","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"ec3780c80877bbdc3c3e1ea3013abea8c6756406","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        finally:"},{"line_number":115,"context_line":"            del self.running_jobs[name]"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def _process_result(self, status, msg, name, queue_instance):"},{"line_number":118,"context_line":"        if name not in self.statuses:"},{"line_number":119,"context_line":"            self.statuses[name] \u003d []"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa31d9ce_5465d4b2","line":117,"range":{"start_line":117,"start_character":8,"end_line":117,"end_character":23},"in_reply_to":"fa31d9ce_69076118","updated":"2017-02-13 22:54:18.000000000","message":"Good question. The original implementation detects the failure status and restarts the thread pool. But the failure status was from inside the individual check call, has nothing to do the health of the thread pool. Restarting the pool is not expected to fix the failure condition unless I missed something here. Restarting the pool may throw off what was running in the thread pool. That\u0027s why I removed the failure condition check.","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"}],"monasca_agent/collector/daemon.py":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"6277d57783e7443fe7717f27f9101314b4cb72f6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# (C) Copyright 2015-2017 Hewlett Packard Enterprise Development Company LP"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"# Core modules"},{"line_number":5,"context_line":"import glob"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_e5c61c67","line":2,"range":{"start_line":2,"start_character":65,"end_line":2,"end_character":72},"updated":"2017-01-27 23:03:59.000000000","message":"Remove Company","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"6277d57783e7443fe7717f27f9101314b4cb72f6","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _handle_sigusr1(self, signum, frame):"},{"line_number":59,"context_line":"        log.debug(\"Caught sigusrl.\")"},{"line_number":60,"context_line":"        self._stop(120)"},{"line_number":61,"context_line":"        sys.exit(monasca_agent.common.daemon.AgentSupervisor.RESTART_EXIT_STATUS)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def _stop(self, timeout\u003d0):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_85855808","line":60,"range":{"start_line":60,"start_character":19,"end_line":60,"end_character":22},"updated":"2017-01-27 23:03:59.000000000","message":"Given the comment at line 292 in monasca_agent/collector/checks/collector.py, should this really be non zero? Have you tried it?","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"a699632b91630972a5ac63adb28968f0946881b1","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _handle_sigusr1(self, signum, frame):"},{"line_number":59,"context_line":"        log.debug(\"Caught sigusrl.\")"},{"line_number":60,"context_line":"        self._stop(120)"},{"line_number":61,"context_line":"        sys.exit(monasca_agent.common.daemon.AgentSupervisor.RESTART_EXIT_STATUS)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def _stop(self, timeout\u003d0):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_61aff22b","line":60,"range":{"start_line":60,"start_character":19,"end_line":60,"end_character":22},"in_reply_to":"3a461143_1076af3d","updated":"2017-02-01 19:29:12.000000000","message":"Yes, I verified that the built in auto restart works with 120. monasca agent service status shows the collector process restarted and new ID. Is there an external or manual cmd that I need to test as well?","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"f5b2397ff17d2329c8d8e346a38aaab82740336f","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _handle_sigusr1(self, signum, frame):"},{"line_number":59,"context_line":"        log.debug(\"Caught sigusrl.\")"},{"line_number":60,"context_line":"        self._stop(120)"},{"line_number":61,"context_line":"        sys.exit(monasca_agent.common.daemon.AgentSupervisor.RESTART_EXIT_STATUS)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def _stop(self, timeout\u003d0):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_41167656","line":60,"range":{"start_line":60,"start_character":19,"end_line":60,"end_character":22},"in_reply_to":"3a461143_61aff22b","updated":"2017-02-01 19:32:37.000000000","message":"If you have this running somewhere, send a SIGUSR1 to the collector and see if it restarts or if it has an exception","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"c2733589b2af91a2de1cdb73c34f2189e814cba3","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _handle_sigusr1(self, signum, frame):"},{"line_number":59,"context_line":"        log.debug(\"Caught sigusrl.\")"},{"line_number":60,"context_line":"        self._stop(120)"},{"line_number":61,"context_line":"        sys.exit(monasca_agent.common.daemon.AgentSupervisor.RESTART_EXIT_STATUS)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def _stop(self, timeout\u003d0):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_fe61b412","line":60,"range":{"start_line":60,"start_character":19,"end_line":60,"end_character":22},"in_reply_to":"3a461143_61aff22b","updated":"2017-02-02 00:52:32.000000000","message":"yes, I\u0027ve tried kill -10 and that restarted the collector process.","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"ed5c304642cba2e078a9613217d96eb20b4acef4","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _handle_sigusr1(self, signum, frame):"},{"line_number":59,"context_line":"        log.debug(\"Caught sigusrl.\")"},{"line_number":60,"context_line":"        self._stop(120)"},{"line_number":61,"context_line":"        sys.exit(monasca_agent.common.daemon.AgentSupervisor.RESTART_EXIT_STATUS)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def _stop(self, timeout\u003d0):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_1076af3d","line":60,"range":{"start_line":60,"start_character":19,"end_line":60,"end_character":22},"in_reply_to":"3a461143_639e64ba","updated":"2017-01-31 15:10:17.000000000","message":"I agree it is probably for restart invoked from an external cmd. So, have you tested if it will work with using 120 instead of 0 as the timeout value?","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"99a1370dc083401459168c78e6574055cdf33c6e","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _handle_sigusr1(self, signum, frame):"},{"line_number":59,"context_line":"        log.debug(\"Caught sigusrl.\")"},{"line_number":60,"context_line":"        self._stop(120)"},{"line_number":61,"context_line":"        sys.exit(monasca_agent.common.daemon.AgentSupervisor.RESTART_EXIT_STATUS)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def _stop(self, timeout\u003d0):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_639e64ba","line":60,"range":{"start_line":60,"start_character":19,"end_line":60,"end_character":22},"in_reply_to":"3a461143_77f4625a","updated":"2017-01-31 05:45:53.000000000","message":"It does listen to the sigusr1. But there is also an auto restart check in the main loop. I don\u0027t have the entire history, maybe the sigusr1 is for the restart invoked from an external cmd or program?","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"31ceb420bdb90102bf02acaa943c28f44b7d4c17","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _handle_sigusr1(self, signum, frame):"},{"line_number":59,"context_line":"        log.debug(\"Caught sigusrl.\")"},{"line_number":60,"context_line":"        self._stop(120)"},{"line_number":61,"context_line":"        sys.exit(monasca_agent.common.daemon.AgentSupervisor.RESTART_EXIT_STATUS)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def _stop(self, timeout\u003d0):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_f2b787d5","line":60,"range":{"start_line":60,"start_character":19,"end_line":60,"end_character":22},"in_reply_to":"3a461143_85855808","updated":"2017-01-30 21:43:31.000000000","message":"yes should be non zero for auto restart. It is safe because auto restart execution is in the main thread so no issue with the blocking switchout event and we use fixed timeout in the join() call. It is more desirable to give the workers a grace period to finish up before we force the auto restart.","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"9d64adc4dd2187bc08331e36448b4ac3ec0811e5","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _handle_sigusr1(self, signum, frame):"},{"line_number":59,"context_line":"        log.debug(\"Caught sigusrl.\")"},{"line_number":60,"context_line":"        self._stop(120)"},{"line_number":61,"context_line":"        sys.exit(monasca_agent.common.daemon.AgentSupervisor.RESTART_EXIT_STATUS)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def _stop(self, timeout\u003d0):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_77f4625a","line":60,"range":{"start_line":60,"start_character":19,"end_line":60,"end_character":22},"in_reply_to":"3a461143_f2b787d5","updated":"2017-01-31 01:53:22.000000000","message":"Does autorestart use sigusr1?","commit_id":"6276cec5839605fb9a138a2cc351fa9a1a1c95e4"}],"requirements.txt":[{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"c2fcc03ea08667e8c57439492f9951814c1c269f","unresolved":false,"context_lines":[{"line_number":20,"context_line":"supervisor\u003e\u003d3.1.3,\u003c3.4"},{"line_number":21,"context_line":"stevedore\u003e\u003d1.17.1 # Apache-2.0"},{"line_number":22,"context_line":"tornado\u003e\u003d4.3"},{"line_number":23,"context_line":"futures\u003e\u003d2.1.3"}],"source_content_type":"text/plain","patch_set":7,"id":"fa31d9ce_e98ef177","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":14},"updated":"2017-02-13 22:04:54.000000000","message":"This should be set to the futures line in global-requirements if possible.  Current futures import is:\n\nfutures\u003e\u003d3.0;python_version\u003d\u003d\u00272.7\u0027 or python_version\u003d\u003d\u00272.6\u0027 # BSD","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"f9be6f194f28984f4319c01a42ac85df4a6a8cdd","unresolved":false,"context_lines":[{"line_number":20,"context_line":"supervisor\u003e\u003d3.1.3,\u003c3.4"},{"line_number":21,"context_line":"stevedore\u003e\u003d1.17.1 # Apache-2.0"},{"line_number":22,"context_line":"tornado\u003e\u003d4.3"},{"line_number":23,"context_line":"futures\u003e\u003d2.1.3"}],"source_content_type":"text/plain","patch_set":7,"id":"fa31d9ce_44d27f5d","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":14},"in_reply_to":"fa31d9ce_3476a0a4","updated":"2017-02-14 00:49:09.000000000","message":"https://github.com/openstack/requirements/blob/master/global-requirements.txt","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"ec3780c80877bbdc3c3e1ea3013abea8c6756406","unresolved":false,"context_lines":[{"line_number":20,"context_line":"supervisor\u003e\u003d3.1.3,\u003c3.4"},{"line_number":21,"context_line":"stevedore\u003e\u003d1.17.1 # Apache-2.0"},{"line_number":22,"context_line":"tornado\u003e\u003d4.3"},{"line_number":23,"context_line":"futures\u003e\u003d2.1.3"}],"source_content_type":"text/plain","patch_set":7,"id":"fa31d9ce_3476a0a4","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":14},"in_reply_to":"fa31d9ce_e98ef177","updated":"2017-02-13 22:54:18.000000000","message":"where can I find the global requirements file?","commit_id":"b3aed85c759dd88cbb850d40586e9b049b8f34db"},{"author":{"_account_id":14517,"name":"Ryan Brandt","email":"ryan.brandt@hpe.com","username":"ryan-brandt"},"change_message_id":"80311ea718e7711107ec186866a55b7f50fee2d2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"bff0334d_1fe991e4","line":25,"updated":"2017-04-12 16:44:03.000000000","message":"If the agent is calling it directly, shouldn\u0027t eventlet be in here explicitly as well?","commit_id":"ab796c388444e35e63d759f1ced214894d182500"},{"author":{"_account_id":24580,"name":"James Gu","email":"james.gu@microsoft.com","username":"jamesgu"},"change_message_id":"8a2af782c3a8d055ede9b55270d6b83e63610f64","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"7ffa3b31_94e97cb8","line":25,"in_reply_to":"bff0334d_1fe991e4","updated":"2017-04-19 15:08:56.000000000","message":"good point. if that\u0027s the pattern (which I \u0027d agree), we can add that.","commit_id":"ab796c388444e35e63d759f1ced214894d182500"}]}
