)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"a75c0ee04ca44b179ff9b68f4889e2ba0f9d5751","unresolved":false,"context_lines":[{"line_number":15,"context_line":"shade\u0027s TaskManager directly rather than just implemeting the same"},{"line_number":16,"context_line":"interface (because we need to make sure thread pools get set up and"},{"line_number":17,"context_line":"whatnot) - also add optional statsd support so that the interface is"},{"line_number":18,"context_line":"clean for nodepool."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Co-Authored-By: David Shrewsbury \u003cshrewsbury.dave@gmail.com\u003e"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7a3c09a3_3779ba30","line":18,"updated":"2017-01-12 22:01:45.000000000","message":"Do you mean you want nodepool to *subclass* this?  That makes more sense to me, since I don\u0027t see how this performs the cross-thread serialization/rate-limiting that nodepool\u0027s taskmanager does.","commit_id":"517c115cb429f468404329d0b3e0b63a00337ed9"}],"shade/task_manager.py":[{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"6819e91dc1633bc0ab1b51c3522d17651a0d021b","unresolved":false,"context_lines":[{"line_number":246,"context_line":"    def stop(self):"},{"line_number":247,"context_line":"        \"\"\" This is a direct action passthrough TaskManager \"\"\""},{"line_number":248,"context_line":"        if self.manager:"},{"line_number":249,"context_line":"            self.manager.shutdown(wait\u003dTrue)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def run(self):"},{"line_number":252,"context_line":"        \"\"\" This is a direct action passthrough TaskManager \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a57fde8_d6878010","line":249,"updated":"2017-01-12 15:40:08.000000000","message":"s/manager/__executor/  ??","commit_id":"d7801056962f7e5ec849d53d30c8515cbbbdd0bd"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"6819e91dc1633bc0ab1b51c3522d17651a0d021b","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    def _run_task_async(self, task, raw\u003dFalse):"},{"line_number":266,"context_line":"        self.log.debug("},{"line_number":267,"context_line":"            \"Manager %s submitting task %s\", self.name, task.name)"},{"line_number":268,"context_line":"        return self._manager.submit(self._run_task, task, raw\u003draw)"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def run_task(self, task, raw\u003dFalse):"},{"line_number":271,"context_line":"        if hasattr(task, \u0027run_async\u0027) and task.run_async:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a57fde8_b673dc4c","line":268,"updated":"2017-01-12 15:40:08.000000000","message":"s/_manager/__executor/ ??","commit_id":"d7801056962f7e5ec849d53d30c8515cbbbdd0bd"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"a75c0ee04ca44b179ff9b68f4889e2ba0f9d5751","unresolved":false,"context_lines":[{"line_number":26,"context_line":"try:"},{"line_number":27,"context_line":"    import stats"},{"line_number":28,"context_line":"except ImportError:"},{"line_number":29,"context_line":"    stats \u003d None"},{"line_number":30,"context_line":"import six"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"from shade import _log"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a3c09a3_5776463f","line":29,"updated":"2017-01-12 22:01:45.000000000","message":"\u0027stats\u0027 is a module in nodepool which has a function for creating a statsd client based on environment variables (or, potentially in the future, other configuration methods).  The actual statsd module is statsd.","commit_id":"517c115cb429f468404329d0b3e0b63a00337ed9"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"a75c0ee04ca44b179ff9b68f4889e2ba0f9d5751","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        self.__executor \u003d None"},{"line_number":226,"context_line":"        self._statsd_prefix \u003d statsd_prefix"},{"line_number":227,"context_line":"        if stats:"},{"line_number":228,"context_line":"            self.statsd \u003d stats.get_client()"},{"line_number":229,"context_line":"        else:"},{"line_number":230,"context_line":"            self.statsd \u003d None"},{"line_number":231,"context_line":"        if not result_filter_cb:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a3c09a3_7773424e","line":228,"updated":"2017-01-12 22:01:45.000000000","message":"If you were to do this, I would recommend that instead of doing something like nodepool.stats.get_client, you include all 3 statsd arguments (host, port, prefix) here and create a statsd client directly.\n\nHowever, I think that TaskManager should be subclassable and that\u0027s a good way to extend it for stats reporting.  So I don\u0027t think shade needs to do anything with statsd, and can leave it up to subclassed taskmanagers (including nodepool) to do it.  That\u0027s a pretty trivial amount of work to do that and keeps shade focused.","commit_id":"517c115cb429f468404329d0b3e0b63a00337ed9"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"a75c0ee04ca44b179ff9b68f4889e2ba0f9d5751","unresolved":false,"context_lines":[{"line_number":234,"context_line":"            self._result_filter_cb \u003d result_filter_cb"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    @property"},{"line_number":237,"context_line":"    def _executor(self):"},{"line_number":238,"context_line":"        if not self.__executor:"},{"line_number":239,"context_line":"            self.__executor \u003d concurrent.futures.ThreadPoolExecutor("},{"line_number":240,"context_line":"                max_workers\u003dself._workers)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a3c09a3_978eee25","line":237,"updated":"2017-01-12 22:01:45.000000000","message":"In order for this to be thread safe, we would need to wrap it in a lock.\n\nHowever, ThreadPoolExecutor has almost no overhead until you actually use it, so instead, I recommend just constructing it in the class constructor so we don\u0027t have to worry about that.","commit_id":"517c115cb429f468404329d0b3e0b63a00337ed9"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"a75c0ee04ca44b179ff9b68f4889e2ba0f9d5751","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        :param task: The task to execute."},{"line_number":260,"context_line":"        :param bool raw: If True, return the raw result as received from the"},{"line_number":261,"context_line":"            underlying client call."},{"line_number":262,"context_line":"        :param bool run_async: Whether to run the task in a thread pool."},{"line_number":263,"context_line":"        \"\"\""},{"line_number":264,"context_line":"        return self.run_task(task\u003dtask, raw\u003draw)"},{"line_number":265,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7a3c09a3_b793ea4e","line":262,"updated":"2017-01-12 22:01:45.000000000","message":"This param doesn\u0027t belong here.","commit_id":"517c115cb429f468404329d0b3e0b63a00337ed9"}]}
