)]}'
{"setup.cfg":[{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"dfa3cdd95ca3e52d74bde3dab0e1b76462995775","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    volume \u003d smaug.services.protection.protectable_plugins.volume:VolumeProtectablePlugin"},{"line_number":52,"context_line":"    image \u003d smaug.services.protection.protectable_plugins.image:ImageProtectablePlugin"},{"line_number":53,"context_line":"smaug.operationengine.engine.executor \u003d"},{"line_number":54,"context_line":"    executor \u003d smaug.services.operationengine.engine.executors.green_thread_executor:GreenThreadExecutor"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"[build_sphinx]"},{"line_number":57,"context_line":"source-dir \u003d doc/source"}],"source_content_type":"text/x-ttcn-cfg","patch_set":2,"id":"1ac06dbe_7fdc8fe4","line":54,"range":{"start_line":54,"start_character":0,"end_line":54,"end_character":104},"updated":"2016-08-21 07:03:27.000000000","message":"add the green thread executor instead of replacing.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"2787ca86d958b9cb9199998bab5deedfd47def7a","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    volume \u003d smaug.services.protection.protectable_plugins.volume:VolumeProtectablePlugin"},{"line_number":52,"context_line":"    image \u003d smaug.services.protection.protectable_plugins.image:ImageProtectablePlugin"},{"line_number":53,"context_line":"smaug.operationengine.engine.executor \u003d"},{"line_number":54,"context_line":"    executor \u003d smaug.services.operationengine.engine.executors.green_thread_executor:GreenThreadExecutor"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"[build_sphinx]"},{"line_number":57,"context_line":"source-dir \u003d doc/source"}],"source_content_type":"text/x-ttcn-cfg","patch_set":2,"id":"1ac06dbe_fd3b5de9","line":54,"range":{"start_line":54,"start_character":0,"end_line":54,"end_character":104},"in_reply_to":"1ac06dbe_7fdc8fe4","updated":"2016-08-22 03:34:34.000000000","message":"BTW, the thread pool may not a good executor in our use cases,\nso we may delete the codes about it some time later. Certainly,\nwe should support multiple executors to exist.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4185238929850650beaaf6ca9a0391a9b523312a","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    volume \u003d smaug.services.protection.protectable_plugins.volume:VolumeProtectablePlugin"},{"line_number":52,"context_line":"    image \u003d smaug.services.protection.protectable_plugins.image:ImageProtectablePlugin"},{"line_number":53,"context_line":"smaug.operationengine.engine.executor \u003d"},{"line_number":54,"context_line":"    executor \u003d smaug.services.operationengine.engine.executors.green_thread_executor:GreenThreadExecutor"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"[build_sphinx]"},{"line_number":57,"context_line":"source-dir \u003d doc/source"}],"source_content_type":"text/x-ttcn-cfg","patch_set":2,"id":"1ac06dbe_9df1896d","line":54,"range":{"start_line":54,"start_character":0,"end_line":54,"end_character":104},"in_reply_to":"1ac06dbe_7fdc8fe4","updated":"2016-08-22 03:26:37.000000000","message":"We can loads multiple executors, but use only one of them. So we\nmay add a configuration to specify which one to use. right?","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"b3cb95809bde505970a78ab86c8fbc88ff110cc8","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    volume \u003d smaug.services.protection.protectable_plugins.volume:VolumeProtectablePlugin"},{"line_number":52,"context_line":"    image \u003d smaug.services.protection.protectable_plugins.image:ImageProtectablePlugin"},{"line_number":53,"context_line":"smaug.operationengine.engine.executor \u003d"},{"line_number":54,"context_line":"    executor \u003d smaug.services.operationengine.engine.executors.green_thread_executor:GreenThreadExecutor"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"[build_sphinx]"},{"line_number":57,"context_line":"source-dir \u003d doc/source"}],"source_content_type":"text/x-ttcn-cfg","patch_set":2,"id":"1ac06dbe_31219e4e","line":54,"range":{"start_line":54,"start_character":0,"end_line":54,"end_character":104},"in_reply_to":"1ac06dbe_fd3b5de9","updated":"2016-08-22 06:56:29.000000000","message":"Yes, we should make it configurable. I somehow thought this is the case.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"}],"smaug/services/operationengine/engine/executors/green_thread_executor.py":[{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"f38958e9e9b93b848008dde35d317615ec04648b","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                operation \u003d objects.ScheduledOperation.get_by_id("},{"line_number":109,"context_line":"                    context.get_admin_context(), operation_id)"},{"line_number":110,"context_line":"            except Exception:"},{"line_number":111,"context_line":"                LOG.exception(_LE(\"Run operation(%s), get operation failed\"),"},{"line_number":112,"context_line":"                              operation_id)"},{"line_number":113,"context_line":"                return"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_d7900398","line":112,"range":{"start_line":111,"start_character":0,"end_line":112,"end_character":43},"updated":"2016-08-03 14:55:25.000000000","message":"Should the state be OPERATION_STATE_REGISTERED on failure?","commit_id":"b1e62a5915e67da2f864e250bbf546bd5b9230a3"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"483fdce6141d2d30d50d5455a8982f1c5fabf670","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                operation \u003d objects.ScheduledOperation.get_by_id("},{"line_number":109,"context_line":"                    context.get_admin_context(), operation_id)"},{"line_number":110,"context_line":"            except Exception:"},{"line_number":111,"context_line":"                LOG.exception(_LE(\"Run operation(%s), get operation failed\"),"},{"line_number":112,"context_line":"                              operation_id)"},{"line_number":113,"context_line":"                return"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_61ba1825","line":112,"range":{"start_line":111,"start_character":0,"end_line":112,"end_character":43},"in_reply_to":"bacf61ea_d7900398","updated":"2016-08-04 02:43:07.000000000","message":"please, look at the comments on line 124 which is more convenient to read. sorry.","commit_id":"b1e62a5915e67da2f864e250bbf546bd5b9230a3"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"0b3fee9746f6f9f44f628cb469374b2d3f9e336a","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                operation \u003d objects.ScheduledOperation.get_by_id("},{"line_number":109,"context_line":"                    context.get_admin_context(), operation_id)"},{"line_number":110,"context_line":"            except Exception:"},{"line_number":111,"context_line":"                LOG.exception(_LE(\"Run operation(%s), get operation failed\"),"},{"line_number":112,"context_line":"                              operation_id)"},{"line_number":113,"context_line":"                return"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_c6295a39","line":112,"range":{"start_line":111,"start_character":0,"end_line":112,"end_character":43},"in_reply_to":"bacf61ea_d7900398","updated":"2016-08-04 02:26:54.000000000","message":"yes. the reasons are as following.\n 1. The changing of operation state is just to show the status of operation. When we want to get the details of operation, the status will be returned.\n 2. If it fails here, this execution will be missed. But, we can not stop the execution of operation when it is triggered next time. If we have mechanism of notification, then we can use it; simply we just write the log.","commit_id":"b1e62a5915e67da2f864e250bbf546bd5b9230a3"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"f38958e9e9b93b848008dde35d317615ec04648b","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                    operation.operation_definition,"},{"line_number":122,"context_line":"                    param\u003dparam)"},{"line_number":123,"context_line":"            except Exception:"},{"line_number":124,"context_line":"                LOG.exception(_LE(\"Run operation(%s) failed\"), operation_id)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        finally:"},{"line_number":127,"context_line":"            self._update_operation_state("}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_cd34f6df","line":124,"range":{"start_line":124,"start_character":15,"end_line":124,"end_character":76},"updated":"2016-08-03 14:55:25.000000000","message":"ditto","commit_id":"b1e62a5915e67da2f864e250bbf546bd5b9230a3"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"bd51abef7cc05ee42739f215e1377630cc90c8b0","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                    operation.operation_definition,"},{"line_number":122,"context_line":"                    param\u003dparam)"},{"line_number":123,"context_line":"            except Exception:"},{"line_number":124,"context_line":"                LOG.exception(_LE(\"Run operation(%s) failed\"), operation_id)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        finally:"},{"line_number":127,"context_line":"            self._update_operation_state("}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_0621b2b4","line":124,"range":{"start_line":124,"start_character":15,"end_line":124,"end_character":76},"in_reply_to":"bacf61ea_cd34f6df","updated":"2016-08-04 02:40:36.000000000","message":"yes. the reasons are as following.\n 1. The changing of operation state is just to show the status of\noperation. When we want to get the details of operation, the \nstatus will be returned.\n 2. If it fails here, this execution will be missed. But, we can\nnot stop the execution of operation when it is triggered next \ntime. If we have mechanism of notification, then we can use it;\nsimply we just write the log.","commit_id":"b1e62a5915e67da2f864e250bbf546bd5b9230a3"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"dfa3cdd95ca3e52d74bde3dab0e1b76462995775","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self._create_thread(self._run_operation, operation_id, param)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def cancel_operation(self, operation_id):"},{"line_number":70,"context_line":"        gt \u003d self._operation_thread_map.get(operation_id, None)"},{"line_number":71,"context_line":"        if gt is not None:  # can not use \u0027if gt\u0027 instead"},{"line_number":72,"context_line":"            # If the thead has not started, it will be killed;"},{"line_number":73,"context_line":"            # else, it will run until finishes its work."},{"line_number":74,"context_line":"            gt.cancel()"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def resume_operation(self, operation_id, **kwargs):"},{"line_number":77,"context_line":"        end_time \u003d kwargs.get(\u0027end_time_for_run\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_ff319f0c","line":74,"range":{"start_line":70,"start_character":0,"end_line":74,"end_character":23},"updated":"2016-08-21 07:03:27.000000000","message":"remove the operation_id from the map in the end?","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"b3cb95809bde505970a78ab86c8fbc88ff110cc8","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self._create_thread(self._run_operation, operation_id, param)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def cancel_operation(self, operation_id):"},{"line_number":70,"context_line":"        gt \u003d self._operation_thread_map.get(operation_id, None)"},{"line_number":71,"context_line":"        if gt is not None:  # can not use \u0027if gt\u0027 instead"},{"line_number":72,"context_line":"            # If the thead has not started, it will be killed;"},{"line_number":73,"context_line":"            # else, it will run until finishes its work."},{"line_number":74,"context_line":"            gt.cancel()"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def resume_operation(self, operation_id, **kwargs):"},{"line_number":77,"context_line":"        end_time \u003d kwargs.get(\u0027end_time_for_run\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_ec6e0dc8","line":74,"range":{"start_line":70,"start_character":0,"end_line":74,"end_character":23},"in_reply_to":"1ac06dbe_dd9ca15f","updated":"2016-08-22 06:56:29.000000000","message":"Correct, my bad","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4185238929850650beaaf6ca9a0391a9b523312a","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self._create_thread(self._run_operation, operation_id, param)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def cancel_operation(self, operation_id):"},{"line_number":70,"context_line":"        gt \u003d self._operation_thread_map.get(operation_id, None)"},{"line_number":71,"context_line":"        if gt is not None:  # can not use \u0027if gt\u0027 instead"},{"line_number":72,"context_line":"            # If the thead has not started, it will be killed;"},{"line_number":73,"context_line":"            # else, it will run until finishes its work."},{"line_number":74,"context_line":"            gt.cancel()"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def resume_operation(self, operation_id, **kwargs):"},{"line_number":77,"context_line":"        end_time \u003d kwargs.get(\u0027end_time_for_run\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_dd9ca15f","line":74,"range":{"start_line":70,"start_character":0,"end_line":74,"end_character":23},"in_reply_to":"1ac06dbe_ff319f0c","updated":"2016-08-22 03:26:37.000000000","message":"Whatever \u0027gt.cancel\u0027 runs successfully or not, the \u0027self._on_gt_done\u0027 will be executed after \u0027gt.cancel\u0027; so we may not remove operation_id here.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"b3cb95809bde505970a78ab86c8fbc88ff110cc8","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            gt.cancel()"},{"line_number":95,"context_line":"            try:"},{"line_number":96,"context_line":"                gt.wait()  # wait untile the thread finishes its work"},{"line_number":97,"context_line":"            except (greenlet.GreenletExit, Exception):"},{"line_number":98,"context_line":"                pass"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def _run_operation(self, operation_id, param):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_51a9ba7a","line":97,"range":{"start_line":97,"start_character":0,"end_line":97,"end_character":54},"updated":"2016-08-22 06:56:29.000000000","message":"isn\u0027t GreenletExit also an Exception? Why catch both?","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"70393f1f382e4fe89c8269f86629c6498e6bcefd","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            gt.cancel()"},{"line_number":95,"context_line":"            try:"},{"line_number":96,"context_line":"                gt.wait()  # wait untile the thread finishes its work"},{"line_number":97,"context_line":"            except (greenlet.GreenletExit, Exception):"},{"line_number":98,"context_line":"                pass"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def _run_operation(self, operation_id, param):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_a996b5ed","line":97,"range":{"start_line":97,"start_character":0,"end_line":97,"end_character":54},"in_reply_to":"1ac06dbe_51a9ba7a","updated":"2016-08-22 11:59:51.000000000","message":"yes, GreenletExit is not a subclass of Exception.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"dfa3cdd95ca3e52d74bde3dab0e1b76462995775","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _on_gt_done(self, gt, *args, **kwargs):"},{"line_number":147,"context_line":"        op_id \u003d args[0]"},{"line_number":148,"context_line":"        self._operation_thread_map.pop(op_id, None)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _create_thread(self, function, operation_id, param):"},{"line_number":151,"context_line":"        gt \u003d eventlet.spawn(function, operation_id, param)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_3fb7b787","line":148,"range":{"start_line":148,"start_character":0,"end_line":148,"end_character":51},"updated":"2016-08-21 07:03:27.000000000","message":"if the value in the map is not important, you can use `del` instead of `pop`","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4185238929850650beaaf6ca9a0391a9b523312a","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _on_gt_done(self, gt, *args, **kwargs):"},{"line_number":147,"context_line":"        op_id \u003d args[0]"},{"line_number":148,"context_line":"        self._operation_thread_map.pop(op_id, None)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _create_thread(self, function, operation_id, param):"},{"line_number":151,"context_line":"        gt \u003d eventlet.spawn(function, operation_id, param)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_1d9f5951","line":148,"range":{"start_line":148,"start_character":0,"end_line":148,"end_character":51},"in_reply_to":"1ac06dbe_3fb7b787","updated":"2016-08-22 03:26:37.000000000","message":"good suggestion. thanks.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"dfa3cdd95ca3e52d74bde3dab0e1b76462995775","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        self._operation_thread_map.pop(op_id, None)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _create_thread(self, function, operation_id, param):"},{"line_number":151,"context_line":"        gt \u003d eventlet.spawn(function, operation_id, param)"},{"line_number":152,"context_line":"        gt.link(self._on_gt_done, operation_id)"},{"line_number":153,"context_line":"        self._operation_thread_map[operation_id] \u003d gt"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_bf9447e2","line":151,"range":{"start_line":151,"start_character":0,"end_line":151,"end_character":58},"updated":"2016-08-21 07:03:27.000000000","message":"add option to limit the amount of running green threads by using greenpool (configurable)","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"70393f1f382e4fe89c8269f86629c6498e6bcefd","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        self._operation_thread_map.pop(op_id, None)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _create_thread(self, function, operation_id, param):"},{"line_number":151,"context_line":"        gt \u003d eventlet.spawn(function, operation_id, param)"},{"line_number":152,"context_line":"        gt.link(self._on_gt_done, operation_id)"},{"line_number":153,"context_line":"        self._operation_thread_map[operation_id] \u003d gt"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_e46f34c3","line":151,"range":{"start_line":151,"start_character":0,"end_line":151,"end_character":58},"in_reply_to":"1ac06dbe_2c96654c","updated":"2016-08-22 11:59:51.000000000","message":"I show you the code of greenpool.spawn:\n    def spawn(self, function, *args, **kwargs):\n        ...\n        else:\n            self.sem.acquire()\n            gt \u003d greenthread.spawn(function, *args, **kwargs)\n            if not self.coroutines_running:\n                self.no_coros_running \u003d event.Event()\n            self.coroutines_running.add(gt)\n            gt.link(self._spawn_done)\n\nThe last line has linked the \u0027self._spawn_done\u0027 to gt, so if we\nchange the link function, there may be a problem.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"b3cb95809bde505970a78ab86c8fbc88ff110cc8","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        self._operation_thread_map.pop(op_id, None)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _create_thread(self, function, operation_id, param):"},{"line_number":151,"context_line":"        gt \u003d eventlet.spawn(function, operation_id, param)"},{"line_number":152,"context_line":"        gt.link(self._on_gt_done, operation_id)"},{"line_number":153,"context_line":"        self._operation_thread_map[operation_id] \u003d gt"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_2c96654c","line":151,"range":{"start_line":151,"start_character":0,"end_line":151,"end_character":58},"in_reply_to":"1ac06dbe_5d739115","updated":"2016-08-22 06:56:29.000000000","message":"http://eventlet.net/doc/modules/greenpool.html\ngreenpool.spawn(...) returns a GreenThread which you can use `.link()` and `.cancel()` on.\nOnly problem with Greenpool is that it blocks when over capacity.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4185238929850650beaaf6ca9a0391a9b523312a","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        self._operation_thread_map.pop(op_id, None)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _create_thread(self, function, operation_id, param):"},{"line_number":151,"context_line":"        gt \u003d eventlet.spawn(function, operation_id, param)"},{"line_number":152,"context_line":"        gt.link(self._on_gt_done, operation_id)"},{"line_number":153,"context_line":"        self._operation_thread_map[operation_id] \u003d gt"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_5d739115","line":151,"range":{"start_line":151,"start_character":0,"end_line":151,"end_character":58},"in_reply_to":"1ac06dbe_bf9447e2","updated":"2016-08-22 03:26:37.000000000","message":"yes, we should limit the amount of green thread. But the \ngreenpoll is not appropriate. Because the thread created by \ngreenpool has been linked with the internal function of greenpool\n, and greenpool does not support the function of cancelling \nthread. We can check the amount of items in \nself._operation_thread_map, if it exceeds the value of option,\nthen raise an exception.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"dfa3cdd95ca3e52d74bde3dab0e1b76462995775","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    def _create_thread(self, function, operation_id, param):"},{"line_number":151,"context_line":"        gt \u003d eventlet.spawn(function, operation_id, param)"},{"line_number":152,"context_line":"        gt.link(self._on_gt_done, operation_id)"},{"line_number":153,"context_line":"        self._operation_thread_map[operation_id] \u003d gt"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_ff951fe4","line":153,"range":{"start_line":153,"start_character":0,"end_line":153,"end_character":53},"updated":"2016-08-21 07:03:27.000000000","message":"eventlet\u0027s `spawn()` returns execution to the caller, but still: can you move this statement before the link to _on_gt_done() ?\n(first assign to the map, then later remove it)","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4185238929850650beaaf6ca9a0391a9b523312a","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    def _create_thread(self, function, operation_id, param):"},{"line_number":151,"context_line":"        gt \u003d eventlet.spawn(function, operation_id, param)"},{"line_number":152,"context_line":"        gt.link(self._on_gt_done, operation_id)"},{"line_number":153,"context_line":"        self._operation_thread_map[operation_id] \u003d gt"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_9d634941","line":153,"range":{"start_line":153,"start_character":0,"end_line":153,"end_character":53},"in_reply_to":"1ac06dbe_ff951fe4","updated":"2016-08-22 03:26:37.000000000","message":"good suggestion. thanks.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"}],"smaug/tests/unit/operationengine/engine/executors/test_green_thread_executor.py":[{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"b3cb95809bde505970a78ab86c8fbc88ff110cc8","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self._op_id \u003d operation.id"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def tearDown(self):"},{"line_number":49,"context_line":"        super(GreenThreadExecutorTestCase, self).tearDown()"},{"line_number":50,"context_line":"        self._executor.shutdown()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def test_execute_operation(self):"},{"line_number":53,"context_line":"        now \u003d datetime.utcnow()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_cc851108","line":50,"range":{"start_line":49,"start_character":0,"end_line":50,"end_character":33},"updated":"2016-08-22 06:56:29.000000000","message":"isn\u0027t this in the reverse order?","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"70393f1f382e4fe89c8269f86629c6498e6bcefd","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self._op_id \u003d operation.id"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def tearDown(self):"},{"line_number":49,"context_line":"        super(GreenThreadExecutorTestCase, self).tearDown()"},{"line_number":50,"context_line":"        self._executor.shutdown()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def test_execute_operation(self):"},{"line_number":53,"context_line":"        now \u003d datetime.utcnow()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_be02696d","line":50,"range":{"start_line":49,"start_character":0,"end_line":50,"end_character":33},"in_reply_to":"1ac06dbe_cc851108","updated":"2016-08-22 11:59:51.000000000","message":"got it. thank you.","commit_id":"5f5c3d973f56055cc18af60ac300418c39c6643a"}]}
