)]}'
{"smaug/operationengine/engine/triggers/timetrigger/time_trigger.py":[{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"caef4ccb837e043f797b7e07d1e8d2c8150f711c","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        super(TimeTrigger, self).__init__(executor)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        self._id \u003d trigger_id"},{"line_number":39,"context_line":"        self._operation_ids \u003d set()"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        self._trigger_property \u003d self._get_valid_trigger_property("},{"line_number":42,"context_line":"            trigger_property)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_667f5ee0","line":39,"range":{"start_line":39,"start_character":13,"end_line":39,"end_character":27},"updated":"2016-03-24 04:19:52.000000000","message":"eron \u0026 saggi \u0026 yuval \u0026 everyone. please give me your suggestion that do we need add a lock to self._operation_ids. because the register_operation/unregister_operation will add/remove the operation_id to/from self._operation_ids by rpc request which is executed in Eventlet(our rpc server uses the Eventlet as the executor), and self._trigger_operations which will traverse the self._operation_ids is executed by greenthread. i think these two greenthreads are different, if it is, we should add a lock. in order to reduce the number of locks, we can use a global lock because there are only two greenthreads.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self._trigger_property \u003d self._get_valid_trigger_property("},{"line_number":42,"context_line":"            trigger_property)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        now \u003d utils.utcnow()"},{"line_number":45,"context_line":"        start_time \u003d self._trigger_property[\"start_time\"]"},{"line_number":46,"context_line":"        self._next_run_time \u003d now if (not start_time or start_time \u003c now"},{"line_number":47,"context_line":"                                      ) else start_time"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def register_operation(self, operation_id, **kwargs):"},{"line_number":50,"context_line":"        num \u003d len(self._operation_ids)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_72cd5530","line":47,"range":{"start_line":44,"start_character":0,"end_line":47,"end_character":55},"updated":"2016-03-24 09:28:24.000000000","message":"better to keep the start_time in the object\nno real need to set self._next_run_time here","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self._trigger_property \u003d self._get_valid_trigger_property("},{"line_number":42,"context_line":"            trigger_property)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        now \u003d utils.utcnow()"},{"line_number":45,"context_line":"        start_time \u003d self._trigger_property[\"start_time\"]"},{"line_number":46,"context_line":"        self._next_run_time \u003d now if (not start_time or start_time \u003c now"},{"line_number":47,"context_line":"                                      ) else start_time"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def register_operation(self, operation_id, **kwargs):"},{"line_number":50,"context_line":"        num \u003d len(self._operation_ids)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_50a6d210","line":47,"range":{"start_line":44,"start_character":0,"end_line":47,"end_character":55},"in_reply_to":"fa0719c6_72cd5530","updated":"2016-03-27 06:21:21.000000000","message":"done. look at version 2. thanks.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        self._operation_ids.add(operation_id)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        # willn\u0027t trigger the operations until operation is registered"},{"line_number":54,"context_line":"        if 0 \u003d\u003d num:"},{"line_number":55,"context_line":"            # find the frist run time, we don\u0027t know"},{"line_number":56,"context_line":"            # when the first operation is registered"},{"line_number":57,"context_line":"            now \u003d utils.utcnow()"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_c8a75009","line":54,"range":{"start_line":54,"start_character":0,"end_line":54,"end_character":20},"updated":"2016-03-24 09:28:24.000000000","message":"instead of checking the num of operations, can check if self._greenthread doesn\u0027t exists or not running:\n\nif not self._greenthread or self._greenthread.dead:","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        self._operation_ids.add(operation_id)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        # willn\u0027t trigger the operations until operation is registered"},{"line_number":54,"context_line":"        if 0 \u003d\u003d num:"},{"line_number":55,"context_line":"            # find the frist run time, we don\u0027t know"},{"line_number":56,"context_line":"            # when the first operation is registered"},{"line_number":57,"context_line":"            now \u003d utils.utcnow()"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_b95f5240","line":54,"range":{"start_line":54,"start_character":0,"end_line":54,"end_character":20},"in_reply_to":"fa0719c6_c8a75009","updated":"2016-03-27 06:21:21.000000000","message":"look at version 2. thanks.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            # find the frist run time, we don\u0027t know"},{"line_number":56,"context_line":"            # when the first operation is registered"},{"line_number":57,"context_line":"            now \u003d utils.utcnow()"},{"line_number":58,"context_line":"            next_run_time \u003d self._next_run_time"},{"line_number":59,"context_line":"            first_run_time \u003d next_run_time"},{"line_number":60,"context_line":"            while next_run_time and next_run_time \u003c\u003d now:"},{"line_number":61,"context_line":"                first_run_time \u003d next_run_time"},{"line_number":62,"context_line":"                next_run_time \u003d self._compute_next_run_time("},{"line_number":63,"context_line":"                    next_run_time, self._trigger_property[\u0027end_time\u0027],"},{"line_number":64,"context_line":"                    self._trigger_property[\u0027format\u0027],"},{"line_number":65,"context_line":"                    self._trigger_property[\u0027pattern\u0027])"},{"line_number":66,"context_line":"            self._next_run_time \u003d first_run_time"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"            if self._next_run_time \u003c now:"},{"line_number":69,"context_line":"                greenthread.spawn_n(self._trigger_operations)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_6f660e52","line":66,"range":{"start_line":58,"start_character":0,"end_line":66,"end_character":48},"updated":"2016-03-24 09:28:24.000000000","message":"why not simply:\nself._next_run_time \u003d self._compute_next_run_time(max(utils.utcnow(), self._start_time),...)\n?","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            # find the frist run time, we don\u0027t know"},{"line_number":56,"context_line":"            # when the first operation is registered"},{"line_number":57,"context_line":"            now \u003d utils.utcnow()"},{"line_number":58,"context_line":"            next_run_time \u003d self._next_run_time"},{"line_number":59,"context_line":"            first_run_time \u003d next_run_time"},{"line_number":60,"context_line":"            while next_run_time and next_run_time \u003c\u003d now:"},{"line_number":61,"context_line":"                first_run_time \u003d next_run_time"},{"line_number":62,"context_line":"                next_run_time \u003d self._compute_next_run_time("},{"line_number":63,"context_line":"                    next_run_time, self._trigger_property[\u0027end_time\u0027],"},{"line_number":64,"context_line":"                    self._trigger_property[\u0027format\u0027],"},{"line_number":65,"context_line":"                    self._trigger_property[\u0027pattern\u0027])"},{"line_number":66,"context_line":"            self._next_run_time \u003d first_run_time"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"            if self._next_run_time \u003c now:"},{"line_number":69,"context_line":"                greenthread.spawn_n(self._trigger_operations)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_90fa2abc","line":66,"range":{"start_line":58,"start_character":0,"end_line":66,"end_character":48},"in_reply_to":"fa0719c6_6f660e52","updated":"2016-03-27 06:21:21.000000000","message":"please look at comments on version 3.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                    self._trigger_property[\u0027pattern\u0027])"},{"line_number":66,"context_line":"            self._next_run_time \u003d first_run_time"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"            if self._next_run_time \u003c now:"},{"line_number":69,"context_line":"                greenthread.spawn_n(self._trigger_operations)"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                wait_time \u003d self._calculate_time_interval_to_seconds("},{"line_number":72,"context_line":"                    now, self._next_run_time)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_d2a42109","line":69,"range":{"start_line":68,"start_character":0,"end_line":69,"end_character":61},"updated":"2016-03-24 09:28:24.000000000","message":"how can self._next_run_time be before now?","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                    self._trigger_property[\u0027pattern\u0027])"},{"line_number":66,"context_line":"            self._next_run_time \u003d first_run_time"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"            if self._next_run_time \u003c now:"},{"line_number":69,"context_line":"                greenthread.spawn_n(self._trigger_operations)"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                wait_time \u003d self._calculate_time_interval_to_seconds("},{"line_number":72,"context_line":"                    now, self._next_run_time)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_995a4e4f","line":69,"range":{"start_line":68,"start_character":0,"end_line":69,"end_character":61},"in_reply_to":"fa0719c6_d2a42109","updated":"2016-03-27 06:21:21.000000000","message":"look at comments on version 2. thanks.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                wait_time \u003d self._calculate_time_interval_to_seconds("},{"line_number":72,"context_line":"                    now, self._next_run_time)"},{"line_number":73,"context_line":"                greenthread.apawn_after(wait_time, self._trigger_operations)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def unregister_operation(self, operation_id, **kwargs):"},{"line_number":76,"context_line":"        if operation_id in self._operation_ids:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_d20ee1e3","line":73,"range":{"start_line":73,"start_character":0,"end_line":73,"end_character":76},"updated":"2016-03-24 09:28:24.000000000","message":"apawn_after -\u003e spawn_after\nkeep the result GreenThread in the object, for when we want to change the trigger recurrence","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                wait_time \u003d self._calculate_time_interval_to_seconds("},{"line_number":72,"context_line":"                    now, self._next_run_time)"},{"line_number":73,"context_line":"                greenthread.apawn_after(wait_time, self._trigger_operations)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def unregister_operation(self, operation_id, **kwargs):"},{"line_number":76,"context_line":"        if operation_id in self._operation_ids:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_509a5264","line":73,"range":{"start_line":73,"start_character":0,"end_line":73,"end_character":76},"in_reply_to":"fa0719c6_d20ee1e3","updated":"2016-03-27 06:21:21.000000000","message":"Done","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                greenthread.apawn_after(wait_time, self._trigger_operations)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def unregister_operation(self, operation_id, **kwargs):"},{"line_number":76,"context_line":"        if operation_id in self._operation_ids:"},{"line_number":77,"context_line":"            self._operation_ids.remove(operation_id)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def _trigger_operations(self):"},{"line_number":80,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_0d0b1a2b","line":77,"range":{"start_line":76,"start_character":0,"end_line":77,"end_character":52},"updated":"2016-03-24 09:28:24.000000000","message":"can add that:\nif len(self._operations_ids) \u003d\u003d 0:\n  self._greenthread.cancel()\n  self._greenthread \u003d None","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                greenthread.apawn_after(wait_time, self._trigger_operations)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def unregister_operation(self, operation_id, **kwargs):"},{"line_number":76,"context_line":"        if operation_id in self._operation_ids:"},{"line_number":77,"context_line":"            self._operation_ids.remove(operation_id)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def _trigger_operations(self):"},{"line_number":80,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_309d1e5a","line":77,"range":{"start_line":76,"start_character":0,"end_line":77,"end_character":52},"in_reply_to":"fa0719c6_0d0b1a2b","updated":"2016-03-27 06:21:21.000000000","message":"done. look at version 2. thanks.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                wait_time \u003d self._compute_time_interval_to_seconds("},{"line_number":85,"context_line":"                    now, self._next_run_time)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"                greenthread.sleep(wait_time)"},{"line_number":88,"context_line":"                continue"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"            window \u003d self._trigger_property[\u0027window\u0027]"},{"line_number":91,"context_line":"            if now \u003e (expect_run_time + timedelta(seconds\u003dwindow)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_cd5ac2f1","line":88,"range":{"start_line":87,"start_character":0,"end_line":88,"end_character":24},"updated":"2016-03-24 09:28:24.000000000","message":"I advise to remove the \"while True\" above, and do: (for easier TimeTrigger recurrence changing)\n\nself._green_thread \u003d greenthread.spawn_after(wait_time, self._trigger_operations)\nreturn","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                wait_time \u003d self._compute_time_interval_to_seconds("},{"line_number":85,"context_line":"                    now, self._next_run_time)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"                greenthread.sleep(wait_time)"},{"line_number":88,"context_line":"                continue"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"            window \u003d self._trigger_property[\u0027window\u0027]"},{"line_number":91,"context_line":"            if now \u003e (expect_run_time + timedelta(seconds\u003dwindow)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_19359ef6","line":88,"range":{"start_line":87,"start_character":0,"end_line":88,"end_character":24},"in_reply_to":"fa0719c6_cd5ac2f1","updated":"2016-03-27 06:21:21.000000000","message":"i don\u0027t want to create greenthead on every loop. look at version 2. i think i probably have solved it. thanks.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            wait_time \u003d self._compute_time_interval_to_seconds("},{"line_number":119,"context_line":"                now, self._next_run_time)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"            greenthread.sleep(wait_time)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    @classmethod"},{"line_number":124,"context_line":"    def check_trigger_definition(cls, trigger_definition):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_4d1512e3","line":121,"range":{"start_line":121,"start_character":0,"end_line":121,"end_character":40},"updated":"2016-03-24 09:28:24.000000000","message":"as said above, I advise changing this into:\nself._green_thread \u003d greenthread.spawn_after(...)","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            wait_time \u003d self._compute_time_interval_to_seconds("},{"line_number":119,"context_line":"                now, self._next_run_time)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"            greenthread.sleep(wait_time)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    @classmethod"},{"line_number":124,"context_line":"    def check_trigger_definition(cls, trigger_definition):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_793c9ae2","line":121,"range":{"start_line":121,"start_character":0,"end_line":121,"end_character":40},"in_reply_to":"fa0719c6_4d1512e3","updated":"2016-03-27 06:21:21.000000000","message":"look at version 2. thanks.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @classmethod"},{"line_number":170,"context_line":"    def _compute_time_interval_to_seconds(cls, current_time, next_time):"},{"line_number":171,"context_line":"        delta \u003d next_time - current_time"},{"line_number":172,"context_line":"        return delta.days * 24 * 60 * 60 + delta.seconds +\\"},{"line_number":173,"context_line":"            delta.microseconds / 1000000.0"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    @classmethod"},{"line_number":176,"context_line":"    def _compute_next_run_time(cls, start_time, end_time,"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_f2cfa553","line":173,"range":{"start_line":171,"start_character":0,"end_line":173,"end_character":42},"updated":"2016-03-24 09:28:24.000000000","message":"can use:\ntimeutils.delta_seconds(current_time, next_time)\nand event eliminate this function, and use the timeutils inline","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @classmethod"},{"line_number":170,"context_line":"    def _compute_time_interval_to_seconds(cls, current_time, next_time):"},{"line_number":171,"context_line":"        delta \u003d next_time - current_time"},{"line_number":172,"context_line":"        return delta.days * 24 * 60 * 60 + delta.seconds +\\"},{"line_number":173,"context_line":"            delta.microseconds / 1000000.0"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    @classmethod"},{"line_number":176,"context_line":"    def _compute_next_run_time(cls, start_time, end_time,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_593f16d6","line":173,"range":{"start_line":171,"start_character":0,"end_line":173,"end_character":42},"in_reply_to":"fa0719c6_f2cfa553","updated":"2016-03-27 06:21:21.000000000","message":"it is great. i have learned one more good method from you. thank you very much.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        return None"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    @classmethod"},{"line_number":187,"context_line":"    def _get_valid_trigger_property(cls, trigger_property):"},{"line_number":188,"context_line":"        def _get_datetime(time_key):"},{"line_number":189,"context_line":"            if time_key not in trigger_property:"},{"line_number":190,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_ed0b467b","line":187,"range":{"start_line":187,"start_character":0,"end_line":187,"end_character":59},"updated":"2016-03-24 09:28:24.000000000","message":"can be merged with check_trigger_definition(), most flow is the same, just throw the exceptions from here","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        return None"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    @classmethod"},{"line_number":187,"context_line":"    def _get_valid_trigger_property(cls, trigger_property):"},{"line_number":188,"context_line":"        def _get_datetime(time_key):"},{"line_number":189,"context_line":"            if time_key not in trigger_property:"},{"line_number":190,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_d92b2693","line":187,"range":{"start_line":187,"start_character":0,"end_line":187,"end_character":59},"in_reply_to":"fa0719c6_ed0b467b","updated":"2016-03-27 06:21:21.000000000","message":"i don\u0027t want to merge the different functions to one. the check_trigger_definition is just used for check, and the _get_valid_trigger_property will invoke check_trigger_definition and get valid trigger property.","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"a65348dbfb27e38095c7e4ca1e7983a6165f45fc","unresolved":false,"context_lines":[{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        valid_property \u003d {}"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        cls.check_trigger_property(trigger_property)"},{"line_number":198,"context_line":"        valid_property.update(trigger_property)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        valid_property[\u0027window\u0027] \u003d int(trigger_property.get(\"window\", 60))"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa0719c6_edafc67a","line":197,"range":{"start_line":197,"start_character":0,"end_line":197,"end_character":52},"updated":"2016-03-24 09:28:24.000000000","message":"did you mean check_trigger_definition() ?","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4058fdba304255d619f94961d7e6f66541d8528e","unresolved":false,"context_lines":[{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        valid_property \u003d {}"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        cls.check_trigger_property(trigger_property)"},{"line_number":198,"context_line":"        valid_property.update(trigger_property)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        valid_property[\u0027window\u0027] \u003d int(trigger_property.get(\"window\", 60))"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_b92632cc","line":197,"range":{"start_line":197,"start_character":0,"end_line":197,"end_character":52},"in_reply_to":"fa0719c6_edafc67a","updated":"2016-03-27 06:21:21.000000000","message":"Done","commit_id":"aa2c25c4075b02188af2deb96c4705d17c52a352"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"891c909b82d98e82693cd64bf336d266274d60d5","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        else:"},{"line_number":62,"context_line":"            self._restart_greenthread()"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def update_trigger_property(self, trigger_property):"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        valid_trigger_property \u003d self._get_valid_trigger_property("},{"line_number":67,"context_line":"            trigger_property)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da0c15f0_746f81c5","line":64,"range":{"start_line":64,"start_character":8,"end_line":64,"end_character":31},"updated":"2016-03-27 06:28:21.000000000","message":"we don\u0027t need lock for register_operation/unregister_operation/update_trigger_property, because these 3 functions are invoked by rpc which is run serially and they don\u0027t compete with the self._greenthread which has its own arguments. am i right? yuval, saggi and gampel.","commit_id":"10342384da56b0d8524f495159ab814866a1ff1d"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"9967df42b35010dfe9e6fda2936edacfc5f324b6","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    def _start(self, initial_delay):"},{"line_number":55,"context_line":"        self._running \u003d True"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        self._thread \u003d eventlet.spawn_after("},{"line_number":58,"context_line":"            initial_delay, self._trigger_operations)"},{"line_number":59,"context_line":"        self._thread.link(self._on_done)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _trigger_operations(self):"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        next_run_time \u003d self._first_run_time"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_183e85b8","line":61,"range":{"start_line":57,"start_character":0,"end_line":61,"end_character":34},"updated":"2016-03-28 15:23:57.000000000","message":"Idea: instead of doing operation logic here, sending all the parameters to __init__, send to __init__ a function from TimeTrigger, and send that function to eventlet. This way, TriggerOperationGreenThread doesn\u0027t need to know about operations.","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"11682b85bc7fdc2fd9c0bd2b328ed544e61b5b33","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    def _start(self, initial_delay):"},{"line_number":55,"context_line":"        self._running \u003d True"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        self._thread \u003d eventlet.spawn_after("},{"line_number":58,"context_line":"            initial_delay, self._trigger_operations)"},{"line_number":59,"context_line":"        self._thread.link(self._on_done)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _trigger_operations(self):"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        next_run_time \u003d self._first_run_time"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_34609b35","line":61,"range":{"start_line":57,"start_character":0,"end_line":61,"end_character":34},"in_reply_to":"ba0121b8_183e85b8","updated":"2016-03-29 03:51:48.000000000","message":"Done","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"9967df42b35010dfe9e6fda2936edacfc5f324b6","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                               \u0027expect_run_time\u0027: expect_run_time,"},{"line_number":83,"context_line":"                               \u0027window\u0027: window})"},{"line_number":84,"context_line":"            else:"},{"line_number":85,"context_line":"                for operation_id in self._operation_ids:"},{"line_number":86,"context_line":"                    try:"},{"line_number":87,"context_line":"                        self._executor.execute_operation("},{"line_number":88,"context_line":"                            operation_id, now, expect_run_time, window)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da0c15f0_32b22295","line":85,"range":{"start_line":85,"start_character":0,"end_line":85,"end_character":56},"updated":"2016-03-28 15:23:57.000000000","message":"iterate over a copy of self._operation_ids","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"5804a5fdb46451ab4066de283e8a45fcc4220d32","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                               \u0027expect_run_time\u0027: expect_run_time,"},{"line_number":83,"context_line":"                               \u0027window\u0027: window})"},{"line_number":84,"context_line":"            else:"},{"line_number":85,"context_line":"                for operation_id in self._operation_ids:"},{"line_number":86,"context_line":"                    try:"},{"line_number":87,"context_line":"                        self._executor.execute_operation("},{"line_number":88,"context_line":"                            operation_id, now, expect_run_time, window)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_8176a03c","line":85,"range":{"start_line":85,"start_character":0,"end_line":85,"end_character":56},"in_reply_to":"da0c15f0_32b22295","updated":"2016-03-28 16:23:54.000000000","message":"i think it is not a better way to copy self._operation_ids on every loop. i only copy once when create an instance of TriggerOperationGreenThread or update self._operation_ids","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"9967df42b35010dfe9e6fda2936edacfc5f324b6","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        if operation_id in self._operation_ids:"},{"line_number":131,"context_line":"            return"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        self._operation_ids.add(operation_id)"},{"line_number":134,"context_line":"        if self._greenthread is None:"},{"line_number":135,"context_line":"            self._start_greenthread()"},{"line_number":136,"context_line":"        else:"},{"line_number":137,"context_line":"            self._greenthread.update_operations_ids(self._operation_ids)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def unregister_operation(self, operation_id, **kwargs):"},{"line_number":140,"context_line":"        if operation_id not in self._operation_ids:"}],"source_content_type":"text/x-python","patch_set":5,"id":"da0c15f0_f29a6a62","line":137,"range":{"start_line":133,"start_character":0,"end_line":137,"end_character":72},"updated":"2016-03-28 15:23:57.000000000","message":"Simply add the operation_id to the self._operations_id list","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"5804a5fdb46451ab4066de283e8a45fcc4220d32","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        if operation_id in self._operation_ids:"},{"line_number":131,"context_line":"            return"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        self._operation_ids.add(operation_id)"},{"line_number":134,"context_line":"        if self._greenthread is None:"},{"line_number":135,"context_line":"            self._start_greenthread()"},{"line_number":136,"context_line":"        else:"},{"line_number":137,"context_line":"            self._greenthread.update_operations_ids(self._operation_ids)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def unregister_operation(self, operation_id, **kwargs):"},{"line_number":140,"context_line":"        if operation_id not in self._operation_ids:"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_01e730e5","line":137,"range":{"start_line":133,"start_character":0,"end_line":137,"end_character":72},"in_reply_to":"da0c15f0_f29a6a62","updated":"2016-03-28 16:23:54.000000000","message":"when start greenthread?","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"9967df42b35010dfe9e6fda2936edacfc5f324b6","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        if operation_id not in self._operation_ids:"},{"line_number":141,"context_line":"            return"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        self._operation_ids.remove(operation_id)"},{"line_number":144,"context_line":"        if 0 \u003d\u003d len(self._operation_ids):"},{"line_number":145,"context_line":"            self._kill_greenthread()"},{"line_number":146,"context_line":"        else:"},{"line_number":147,"context_line":"            self._greenthread.update_operations_ids(self._operation_ids)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def update_trigger_property(self, trigger_property):"},{"line_number":150,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da0c15f0_b2b752d7","line":147,"range":{"start_line":143,"start_character":0,"end_line":147,"end_character":72},"updated":"2016-03-28 15:23:57.000000000","message":"Simply remove the operation_id from self._operations_id","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"9967df42b35010dfe9e6fda2936edacfc5f324b6","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def _start_greenthread(self):"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        # find the frist run time"},{"line_number":174,"context_line":"        # because the self._start_time is very old probably,"},{"line_number":175,"context_line":"        # we must find a time which is nearest to now,"},{"line_number":176,"context_line":"        # but not the time after now."},{"line_number":177,"context_line":"        now \u003d utils.utcnow()"},{"line_number":178,"context_line":"        next_run_time \u003d self._start_time"},{"line_number":179,"context_line":"        first_run_time \u003d next_run_time"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        while next_run_time and next_run_time \u003c\u003d now:"},{"line_number":182,"context_line":"            first_run_time \u003d next_run_time"},{"line_number":183,"context_line":"            next_run_time \u003d self._compute_next_run_time("},{"line_number":184,"context_line":"                next_run_time, self._trigger_property[\u0027end_time\u0027],"},{"line_number":185,"context_line":"                self._trigger_property[\u0027format\u0027],"},{"line_number":186,"context_line":"                self._trigger_property[\u0027pattern\u0027])"},{"line_number":187,"context_line":"        self._start_time \u003d first_run_time"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        wait_time \u003d 0 if first_run_time \u003c\u003d now else ("},{"line_number":190,"context_line":"            int(timeutils.delta_seconds(now, first_run_time)))"}],"source_content_type":"text/x-python","patch_set":5,"id":"da0c15f0_52e236a0","line":187,"range":{"start_line":173,"start_character":0,"end_line":187,"end_character":41},"updated":"2016-03-28 15:23:57.000000000","message":"Why not just use\nself._start_time \u003d self._compute_next_run_time(utils.utcnow(), ...)\n?","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"5804a5fdb46451ab4066de283e8a45fcc4220d32","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def _start_greenthread(self):"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        # find the frist run time"},{"line_number":174,"context_line":"        # because the self._start_time is very old probably,"},{"line_number":175,"context_line":"        # we must find a time which is nearest to now,"},{"line_number":176,"context_line":"        # but not the time after now."},{"line_number":177,"context_line":"        now \u003d utils.utcnow()"},{"line_number":178,"context_line":"        next_run_time \u003d self._start_time"},{"line_number":179,"context_line":"        first_run_time \u003d next_run_time"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        while next_run_time and next_run_time \u003c\u003d now:"},{"line_number":182,"context_line":"            first_run_time \u003d next_run_time"},{"line_number":183,"context_line":"            next_run_time \u003d self._compute_next_run_time("},{"line_number":184,"context_line":"                next_run_time, self._trigger_property[\u0027end_time\u0027],"},{"line_number":185,"context_line":"                self._trigger_property[\u0027format\u0027],"},{"line_number":186,"context_line":"                self._trigger_property[\u0027pattern\u0027])"},{"line_number":187,"context_line":"        self._start_time \u003d first_run_time"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        wait_time \u003d 0 if first_run_time \u003c\u003d now else ("},{"line_number":190,"context_line":"            int(timeutils.delta_seconds(now, first_run_time)))"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_a17da4e9","line":187,"range":{"start_line":173,"start_character":0,"end_line":187,"end_character":41},"in_reply_to":"da0c15f0_52e236a0","updated":"2016-03-28 16:23:54.000000000","message":"we should find a time which is nearest to now, but not the time after now. if pass the first argument with utils.utcnow, the self._start_time will be the time after now.","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"9967df42b35010dfe9e6fda2936edacfc5f324b6","unresolved":false,"context_lines":[{"line_number":189,"context_line":"        wait_time \u003d 0 if first_run_time \u003c\u003d now else ("},{"line_number":190,"context_line":"            int(timeutils.delta_seconds(now, first_run_time)))"},{"line_number":191,"context_line":"        self._greenthread \u003d TriggerOperationGreenThread("},{"line_number":192,"context_line":"            wait_time, first_run_time, self._operation_ids,"},{"line_number":193,"context_line":"            self._trigger_property, self._executor)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"da0c15f0_aea08144","line":192,"range":{"start_line":192,"start_character":0,"end_line":192,"end_character":59},"updated":"2016-03-28 15:23:57.000000000","message":"why pass both first_run_time and wait_time?\nwait_time can be inferred from first_run_time in the TriggerOperationGreenThread __init__","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"5804a5fdb46451ab4066de283e8a45fcc4220d32","unresolved":false,"context_lines":[{"line_number":189,"context_line":"        wait_time \u003d 0 if first_run_time \u003c\u003d now else ("},{"line_number":190,"context_line":"            int(timeutils.delta_seconds(now, first_run_time)))"},{"line_number":191,"context_line":"        self._greenthread \u003d TriggerOperationGreenThread("},{"line_number":192,"context_line":"            wait_time, first_run_time, self._operation_ids,"},{"line_number":193,"context_line":"            self._trigger_property, self._executor)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_e1879cd5","line":192,"range":{"start_line":192,"start_character":0,"end_line":192,"end_character":59},"in_reply_to":"da0c15f0_aea08144","updated":"2016-03-28 16:23:54.000000000","message":"got it.","commit_id":"c5854e4a90c2b1ecf2804acf04e68bf2ab55721f"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2318b4887781f4622d3c620a4d8881010252cb18","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self._trigger_property \u003d self._get_valid_trigger_property("},{"line_number":76,"context_line":"            trigger_property)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        now \u003d utils.utcnow()"},{"line_number":79,"context_line":"        start_time \u003d self._trigger_property[\"start_time\"]"},{"line_number":80,"context_line":"        self._next_run_time \u003d now if (not start_time or start_time \u003c now"},{"line_number":81,"context_line":"                                      ) else start_time"},{"line_number":82,"context_line":"        self._greenthread \u003d None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def register_operation(self, operation_id, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_1e1766a4","line":81,"range":{"start_line":78,"start_character":0,"end_line":81,"end_character":55},"updated":"2016-03-29 15:41:36.000000000","message":"Why not just call update_trigger_property()?","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"0a9548df220797194fd7c17094d267ff1910d74e","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            return"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        self._operation_ids.add(operation_id)"},{"line_number":89,"context_line":"        if self._greenthread is None:"},{"line_number":90,"context_line":"            self._start_greenthread()"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def unregister_operation(self, operation_id, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_00043113","line":89,"range":{"start_line":89,"start_character":0,"end_line":89,"end_character":37},"updated":"2016-03-29 08:04:31.000000000","message":"The greenthread can exist, but has finished its operation (_trigger_operations() returning None).\nWe should add a to the condition:\n\"or not self._greenthread.running\"\nor let _trigger_operation() set \"self._greenthread \u003d None\" when it returns None","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"754e6353671afa0a53c33934b7948fd09b418551","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            return"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        self._operation_ids.add(operation_id)"},{"line_number":89,"context_line":"        if self._greenthread is None:"},{"line_number":90,"context_line":"            self._start_greenthread()"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def unregister_operation(self, operation_id, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_81e64eb2","line":89,"range":{"start_line":89,"start_character":0,"end_line":89,"end_character":37},"in_reply_to":"ba0121b8_00043113","updated":"2016-03-30 02:36:39.000000000","message":"i think if the greenthread is not running, we should reject the request of registering operation.user should update the trigger property first, then register operation.","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":16206,"name":"chenhuayi","email":"chenhuayi@huawei.com","username":"chenhuayi2"},"change_message_id":"b1039e36d3853c2c483ceba9a97a3c062ec96beb","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        self._start_greenthread()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def _start_greenthread(self):"},{"line_number":127,"context_line":"        # find the frist run time"},{"line_number":128,"context_line":"        # because the self._next_run_time is very old probably,"},{"line_number":129,"context_line":"        # we must find a time which is nearest to now,"},{"line_number":130,"context_line":"        # but not the time after now."}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_a9f3a909","line":127,"range":{"start_line":127,"start_character":19,"end_line":127,"end_character":24},"updated":"2016-03-29 12:01:10.000000000","message":"s/frist/first","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"754e6353671afa0a53c33934b7948fd09b418551","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        self._start_greenthread()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def _start_greenthread(self):"},{"line_number":127,"context_line":"        # find the frist run time"},{"line_number":128,"context_line":"        # because the self._next_run_time is very old probably,"},{"line_number":129,"context_line":"        # we must find a time which is nearest to now,"},{"line_number":130,"context_line":"        # but not the time after now."}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_01e99e80","line":127,"range":{"start_line":127,"start_character":19,"end_line":127,"end_character":24},"in_reply_to":"ba0121b8_a9f3a909","updated":"2016-03-30 02:36:39.000000000","message":"Done","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"0a9548df220797194fd7c17094d267ff1910d74e","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def _start_greenthread(self):"},{"line_number":127,"context_line":"        # find the frist run time"},{"line_number":128,"context_line":"        # because the self._next_run_time is very old probably,"},{"line_number":129,"context_line":"        # we must find a time which is nearest to now,"},{"line_number":130,"context_line":"        # but not the time after now."},{"line_number":131,"context_line":"        now \u003d utils.utcnow()"},{"line_number":132,"context_line":"        next_run_time \u003d self._next_run_time"},{"line_number":133,"context_line":"        first_run_time \u003d next_run_time"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_143590d9","line":130,"range":{"start_line":128,"start_character":0,"end_line":130,"end_character":37},"updated":"2016-03-29 08:04:31.000000000","message":"why find a time in the past?\nwe want to wait until the next time in the future.","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2318b4887781f4622d3c620a4d8881010252cb18","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                self._trigger_property[\u0027format\u0027],"},{"line_number":140,"context_line":"                self._trigger_property[\u0027pattern\u0027])"},{"line_number":141,"context_line":"        if first_run_time is None:"},{"line_number":142,"context_line":"            LOG.exception(_LE(\"Can not start greengthread, \""},{"line_number":143,"context_line":"                              \"because first_run_time is None\"))"},{"line_number":144,"context_line":"            return"},{"line_number":145,"context_line":"        self._next_run_time \u003d first_run_time"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_5188afe7","line":142,"range":{"start_line":142,"start_character":45,"end_line":142,"end_character":57},"updated":"2016-03-29 15:41:36.000000000","message":"green thread","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"c828e231c9aa0b42014e97f31e5c021a2e2dde42","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                           \u0027expect_run_time\u0027: expect_run_time,"},{"line_number":170,"context_line":"                           \u0027window\u0027: window})"},{"line_number":171,"context_line":"        else:"},{"line_number":172,"context_line":"            for operation_id in self._operation_ids:"},{"line_number":173,"context_line":"                try:"},{"line_number":174,"context_line":"                    self._executor.execute_operation("},{"line_number":175,"context_line":"                        operation_id, now, expect_run_time, window)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_14e2b7d5","line":172,"range":{"start_line":172,"start_character":37,"end_line":172,"end_character":51},"updated":"2016-03-29 03:45:32.000000000","message":"here we are no need to copy self._operation_ids, because we use eventlet, the self._operation_ids is not the critical resource. am i right, yuval?","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"0a9548df220797194fd7c17094d267ff1910d74e","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                           \u0027expect_run_time\u0027: expect_run_time,"},{"line_number":170,"context_line":"                           \u0027window\u0027: window})"},{"line_number":171,"context_line":"        else:"},{"line_number":172,"context_line":"            for operation_id in self._operation_ids:"},{"line_number":173,"context_line":"                try:"},{"line_number":174,"context_line":"                    self._executor.execute_operation("},{"line_number":175,"context_line":"                        operation_id, now, expect_run_time, window)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_f4529cdc","line":172,"range":{"start_line":172,"start_character":37,"end_line":172,"end_character":51},"in_reply_to":"ba0121b8_14e2b7d5","updated":"2016-03-29 08:04:31.000000000","message":"we should iterate over a copy.\nnot because it can be changed concurrently (critical section), but because during eventlet\u0027s \"context switch\", someone can add/remove from that set.","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"758147947f1c7b500a175d3929b6ec288e2e60cd","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                           \u0027expect_run_time\u0027: expect_run_time,"},{"line_number":170,"context_line":"                           \u0027window\u0027: window})"},{"line_number":171,"context_line":"        else:"},{"line_number":172,"context_line":"            for operation_id in self._operation_ids:"},{"line_number":173,"context_line":"                try:"},{"line_number":174,"context_line":"                    self._executor.execute_operation("},{"line_number":175,"context_line":"                        operation_id, now, expect_run_time, window)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_88a94a7e","line":172,"range":{"start_line":172,"start_character":37,"end_line":172,"end_character":51},"in_reply_to":"ba0121b8_f4529cdc","updated":"2016-03-30 07:34:43.000000000","message":"sorry, not quite understand. who and how add/remove the self._operation_ids? isn\u0027t the \u0027context switch\u0027 atomic?","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2318b4887781f4622d3c620a4d8881010252cb18","unresolved":false,"context_lines":[{"line_number":250,"context_line":"            if time_key not in trigger_property:"},{"line_number":251,"context_line":"                return None"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"            return utils.local_to_utc_time("},{"line_number":254,"context_line":"                cls._check_and_get_datetime(trigger_property[time_key],"},{"line_number":255,"context_line":"                                            time_key))"},{"line_number":256,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_88aa23d3","line":253,"range":{"start_line":253,"start_character":19,"end_line":253,"end_character":42},"updated":"2016-03-29 15:41:36.000000000","message":"Isn\u0027t the time set in the trigger in utc anyway?","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"8a3152612d7e30f2cfddbd98441d3a2c18343602","unresolved":false,"context_lines":[{"line_number":250,"context_line":"            if time_key not in trigger_property:"},{"line_number":251,"context_line":"                return None"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"            return utils.local_to_utc_time("},{"line_number":254,"context_line":"                cls._check_and_get_datetime(trigger_property[time_key],"},{"line_number":255,"context_line":"                                            time_key))"},{"line_number":256,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_ac85495a","line":253,"range":{"start_line":253,"start_character":19,"end_line":253,"end_character":42},"in_reply_to":"ba0121b8_88aa23d3","updated":"2016-03-30 02:55:18.000000000","message":"i think the start_time and end_time in trigger_property is local time not the utc. use is familiar with local time.","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2318b4887781f4622d3c620a4d8881010252cb18","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    @classmethod"},{"line_number":248,"context_line":"    def _get_valid_trigger_property(cls, trigger_property):"},{"line_number":249,"context_line":"        def _get_datetime(time_key):"},{"line_number":250,"context_line":"            if time_key not in trigger_property:"},{"line_number":251,"context_line":"                return None"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"            return utils.local_to_utc_time("},{"line_number":254,"context_line":"                cls._check_and_get_datetime(trigger_property[time_key],"},{"line_number":255,"context_line":"                                            time_key))"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        valid_property \u003d {}"},{"line_number":258,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba0121b8_813787af","line":255,"range":{"start_line":249,"start_character":0,"end_line":255,"end_character":54},"updated":"2016-03-29 15:41:36.000000000","message":"_get_datetime() can be used in check_trigger_definition as well. Maybe this should be a member function.","commit_id":"40911706869497c0552a258105d8683b84261d12"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"0ef4be446b39207167a11b68ff533e19b1fb94b3","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def wrap_local_to_utc_time(f):"},{"line_number":31,"context_line":"    def wrap(*arg, **kwargs):"},{"line_number":32,"context_line":"        try:"},{"line_number":33,"context_line":"            time \u003d f(*arg, **kwargs)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_f3905945","line":30,"range":{"start_line":30,"start_character":4,"end_line":30,"end_character":30},"updated":"2016-03-31 14:56:24.000000000","message":"we need to think about adding time zone info to the trigger see my comment below","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"0ef4be446b39207167a11b68ff533e19b1fb94b3","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class TriggerOperationGreenThread(object):"},{"line_number":41,"context_line":"    def __init__(self, first_run_time, f):"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self._running \u003d False"},{"line_number":44,"context_line":"        self._thread \u003d None"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_a0c32956","line":41,"range":{"start_line":41,"start_character":39,"end_line":41,"end_character":40},"updated":"2016-03-31 14:56:24.000000000","message":"Please consider changing f to callback","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"be88e7575bf364714c83b0fb9548fd3a076ee0bf","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class TriggerOperationGreenThread(object):"},{"line_number":41,"context_line":"    def __init__(self, first_run_time, f):"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self._running \u003d False"},{"line_number":44,"context_line":"        self._thread \u003d None"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_2f008165","line":41,"range":{"start_line":41,"start_character":39,"end_line":41,"end_character":40},"in_reply_to":"ba0121b8_5f02ca0a","updated":"2016-04-03 15:59:01.000000000","message":"I mean that f is not a good name for a variable or a function\n\nI think that calling this argument callback_func or callback will be better","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"e12531511cc8e5ca37a9a46e03925b6a76fe29c0","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class TriggerOperationGreenThread(object):"},{"line_number":41,"context_line":"    def __init__(self, first_run_time, f):"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self._running \u003d False"},{"line_number":44,"context_line":"        self._thread \u003d None"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_5f02ca0a","line":41,"range":{"start_line":41,"start_character":39,"end_line":41,"end_character":40},"in_reply_to":"ba0121b8_a0c32956","updated":"2016-04-01 03:02:16.000000000","message":"sorry, not quite understand. why should use callback? where is the callback used?","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"0ef4be446b39207167a11b68ff533e19b1fb94b3","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self._running \u003d False"},{"line_number":44,"context_line":"        self._thread \u003d None"},{"line_number":45,"context_line":"        self._f \u003d f"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self._start(first_run_time)"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_13850d06","line":45,"range":{"start_line":45,"start_character":13,"end_line":45,"end_character":15},"updated":"2016-03-31 14:56:24.000000000","message":"ditto","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"0ef4be446b39207167a11b68ff533e19b1fb94b3","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def _run(self):"},{"line_number":71,"context_line":"        while self._running:"},{"line_number":72,"context_line":"            idle_time \u003d self._f()"},{"line_number":73,"context_line":"            if idle_time is None:"},{"line_number":74,"context_line":"                break"},{"line_number":75,"context_line":"            eventlet.sleep(idle_time)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_1344ed18","line":72,"range":{"start_line":72,"start_character":29,"end_line":72,"end_character":31},"updated":"2016-03-31 14:56:24.000000000","message":"ditto","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"0ef4be446b39207167a11b68ff533e19b1fb94b3","unresolved":false,"context_lines":[{"line_number":172,"context_line":"            # the TimeFormat.compute_next_time will get different time"},{"line_number":173,"context_line":"            # with the different start time as the second argument"},{"line_number":174,"context_line":"            next_run_time \u003d first_run_time"},{"line_number":175,"context_line":"            while next_run_time and next_run_time \u003c\u003d now:"},{"line_number":176,"context_line":"                first_run_time \u003d next_run_time"},{"line_number":177,"context_line":"                next_run_time \u003d self._compute_next_run_time("},{"line_number":178,"context_line":"                    next_run_time, self._trigger_property[\u0027end_time\u0027],"},{"line_number":179,"context_line":"                    self._trigger_property[\u0027format\u0027],"},{"line_number":180,"context_line":"                    self._trigger_property[\u0027pattern\u0027])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"            self._next_run_time \u003d first_run_time"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_60711176","line":180,"range":{"start_line":175,"start_character":11,"end_line":180,"end_character":54},"updated":"2016-03-31 14:56:24.000000000","message":"After discussing this with yuval we think that you can \n\n_compute_next_run_time(now- time_window)","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"53304225fabb91d4976fdff007f8d70ad9cc60aa","unresolved":false,"context_lines":[{"line_number":172,"context_line":"            # the TimeFormat.compute_next_time will get different time"},{"line_number":173,"context_line":"            # with the different start time as the second argument"},{"line_number":174,"context_line":"            next_run_time \u003d first_run_time"},{"line_number":175,"context_line":"            while next_run_time and next_run_time \u003c\u003d now:"},{"line_number":176,"context_line":"                first_run_time \u003d next_run_time"},{"line_number":177,"context_line":"                next_run_time \u003d self._compute_next_run_time("},{"line_number":178,"context_line":"                    next_run_time, self._trigger_property[\u0027end_time\u0027],"},{"line_number":179,"context_line":"                    self._trigger_property[\u0027format\u0027],"},{"line_number":180,"context_line":"                    self._trigger_property[\u0027pattern\u0027])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"            self._next_run_time \u003d first_run_time"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9a061dce_46cf65b0","line":180,"range":{"start_line":175,"start_character":11,"end_line":180,"end_character":54},"in_reply_to":"9a061dce_6c46dfc0","updated":"2016-04-04 15:54:56.000000000","message":"@zengchen lets discuss it all together tomorrow I do not see th e problem  either","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"6da644646e6fbb7812c7b15ef3a8d8039c35f8dd","unresolved":false,"context_lines":[{"line_number":172,"context_line":"            # the TimeFormat.compute_next_time will get different time"},{"line_number":173,"context_line":"            # with the different start time as the second argument"},{"line_number":174,"context_line":"            next_run_time \u003d first_run_time"},{"line_number":175,"context_line":"            while next_run_time and next_run_time \u003c\u003d now:"},{"line_number":176,"context_line":"                first_run_time \u003d next_run_time"},{"line_number":177,"context_line":"                next_run_time \u003d self._compute_next_run_time("},{"line_number":178,"context_line":"                    next_run_time, self._trigger_property[\u0027end_time\u0027],"},{"line_number":179,"context_line":"                    self._trigger_property[\u0027format\u0027],"},{"line_number":180,"context_line":"                    self._trigger_property[\u0027pattern\u0027])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"            self._next_run_time \u003d first_run_time"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_ecb33e96","line":180,"range":{"start_line":175,"start_character":11,"end_line":180,"end_character":54},"in_reply_to":"ba0121b8_60711176","updated":"2016-04-01 02:56:21.000000000","message":"I agree with you. But if we use _compute_next_run_time(now- time_window) to compute the first run time, we must suppose that the TimeFormat.compute_next_time will get same time as long as its second argument is between two time points. For example, if TimeFormat.compute_next_time returns 15:00, 16:00, 17:00 etc based on trigger property, then if start_time is between 15:00 and 16:00, then TimeFormat.compute_next_time will return 16:00.\nBtw, the croniter computes next time like this.","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"acfe70f0cee9a204d1e686ea4681e5329b6c5474","unresolved":false,"context_lines":[{"line_number":172,"context_line":"            # the TimeFormat.compute_next_time will get different time"},{"line_number":173,"context_line":"            # with the different start time as the second argument"},{"line_number":174,"context_line":"            next_run_time \u003d first_run_time"},{"line_number":175,"context_line":"            while next_run_time and next_run_time \u003c\u003d now:"},{"line_number":176,"context_line":"                first_run_time \u003d next_run_time"},{"line_number":177,"context_line":"                next_run_time \u003d self._compute_next_run_time("},{"line_number":178,"context_line":"                    next_run_time, self._trigger_property[\u0027end_time\u0027],"},{"line_number":179,"context_line":"                    self._trigger_property[\u0027format\u0027],"},{"line_number":180,"context_line":"                    self._trigger_property[\u0027pattern\u0027])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"            self._next_run_time \u003d first_run_time"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9a061dce_6c46dfc0","line":180,"range":{"start_line":175,"start_character":11,"end_line":180,"end_character":54},"in_reply_to":"ba0121b8_ecb33e96","updated":"2016-04-04 10:15:42.000000000","message":"I don\u0027t see where the problem is with the example you brought.","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"0ef4be446b39207167a11b68ff533e19b1fb94b3","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        return valid_trigger_property"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"    @classmethod"},{"line_number":264,"context_line":"    @wrap_local_to_utc_time"},{"line_number":265,"context_line":"    def _check_and_get_datetime(cls, time, time_name):"},{"line_number":266,"context_line":"        if not time or isinstance(time, datetime):"},{"line_number":267,"context_line":"            return time"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_333f7188","line":264,"range":{"start_line":264,"start_character":5,"end_line":264,"end_character":27},"updated":"2016-03-31 14:56:24.000000000","message":"You assume that the corn tab format is in UTC ?\n\nMaybe we need to think about adding time zone info in the trigger API ?","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"e12531511cc8e5ca37a9a46e03925b6a76fe29c0","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        return valid_trigger_property"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"    @classmethod"},{"line_number":264,"context_line":"    @wrap_local_to_utc_time"},{"line_number":265,"context_line":"    def _check_and_get_datetime(cls, time, time_name):"},{"line_number":266,"context_line":"        if not time or isinstance(time, datetime):"},{"line_number":267,"context_line":"            return time"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_bf3846d4","line":264,"range":{"start_line":264,"start_character":5,"end_line":264,"end_character":27},"in_reply_to":"ba0121b8_333f7188","updated":"2016-04-01 03:02:16.000000000","message":"I assume that user likes to use local time. so the start_time and end_time is local time. I change them to utc time, because the openstack uses the utc time, such as db.","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"}],"smaug/operationengine/engine/triggers/timetrigger/timeformats/crontab_time.py":[{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"0ef4be446b39207167a11b68ff533e19b1fb94b3","unresolved":false,"context_lines":[{"line_number":31,"context_line":"            raise exception.InvalidInput(msg)"},{"line_number":32,"context_line":"        else:"},{"line_number":33,"context_line":"            try:"},{"line_number":34,"context_line":"                croniter(pattern)"},{"line_number":35,"context_line":"            except Exception:"},{"line_number":36,"context_line":"                msg \u003d (_(\"The trigger pattern(%s) is invalid\") % pattern)"},{"line_number":37,"context_line":"                raise exception.InvalidInput(msg)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_336bf1f2","line":34,"range":{"start_line":34,"start_character":16,"end_line":34,"end_character":33},"updated":"2016-03-31 14:56:24.000000000","message":"we should check that is more then one hour recurrent","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4ba062d5327d200f8e85656ddf6ef3ff2439e26e","unresolved":false,"context_lines":[{"line_number":31,"context_line":"            raise exception.InvalidInput(msg)"},{"line_number":32,"context_line":"        else:"},{"line_number":33,"context_line":"            try:"},{"line_number":34,"context_line":"                croniter(pattern)"},{"line_number":35,"context_line":"            except Exception:"},{"line_number":36,"context_line":"                msg \u003d (_(\"The trigger pattern(%s) is invalid\") % pattern)"},{"line_number":37,"context_line":"                raise exception.InvalidInput(msg)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_df99bac5","line":34,"range":{"start_line":34,"start_character":16,"end_line":34,"end_character":33},"in_reply_to":"ba0121b8_336bf1f2","updated":"2016-04-01 03:09:27.000000000","message":"You mean user should not define the trigger that the interval between recurrences is less than 1 hours? I think the time window should be less than the interval between recurrences.","commit_id":"8751254253d15cb65eacabf954ffc1e190b618e9"}]}
