)]}'
{"blazar/manager/service.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"fdd935a604b1c27d10e23fd7faf5b5a1c7ebdd1f","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                    \u0027set to 0, then these actions are not taken.\u0027),"},{"line_number":43,"context_line":"    cfg.IntOpt(\u0027event_max_retries\u0027,"},{"line_number":44,"context_line":"               default\u003d1,"},{"line_number":45,"context_line":"               max\u003d3,"},{"line_number":46,"context_line":"               help\u003d\u0027Number of times to retry an event action.\u0027)"},{"line_number":47,"context_line":"]"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_856a2b17","line":45,"range":{"start_line":45,"start_character":0,"end_line":45,"end_character":21},"updated":"2018-01-18 09:59:20.000000000","message":"Why max is defined?","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"9b45cd125067ef67a669c4d95799b6bdf9bd7306","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                    \u0027set to 0, then these actions are not taken.\u0027),"},{"line_number":43,"context_line":"    cfg.IntOpt(\u0027event_max_retries\u0027,"},{"line_number":44,"context_line":"               default\u003d1,"},{"line_number":45,"context_line":"               max\u003d3,"},{"line_number":46,"context_line":"               help\u003d\u0027Number of times to retry an event action.\u0027)"},{"line_number":47,"context_line":"]"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_fad9d0f3","line":45,"range":{"start_line":45,"start_character":0,"end_line":45,"end_character":21},"in_reply_to":"7f96bb07_4e918646","updated":"2018-01-23 12:20:32.000000000","message":"Make sense. IMO, 5 is a bit small max as a configurable parameter.  50 or 100?","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"5529637e130bea8b3972b6a56cfe225b65647bc0","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                    \u0027set to 0, then these actions are not taken.\u0027),"},{"line_number":43,"context_line":"    cfg.IntOpt(\u0027event_max_retries\u0027,"},{"line_number":44,"context_line":"               default\u003d1,"},{"line_number":45,"context_line":"               max\u003d3,"},{"line_number":46,"context_line":"               help\u003d\u0027Number of times to retry an event action.\u0027)"},{"line_number":47,"context_line":"]"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_4e918646","line":45,"range":{"start_line":45,"start_character":0,"end_line":45,"end_character":21},"in_reply_to":"7f96bb07_856a2b17","updated":"2018-01-19 05:17:06.000000000","message":"I think the system should provide a limitation for a number of retries because it should not allow unrealistic number of retries like 10,000. \n\nThis retry is just for the case where some API call driven operations are under going when scheduled operation like \u0027start_lease\u0027 is triggered. I think it does not happen frequently. So, large number of retries indicates some other problem and I think it\u0027s better to keep such an event \u0027ERROR\u0027 and do not retry so many times.\n\nI don\u0027t have a strong preference for the actual number of max. 3~5 make sense to me.","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"aceb46ef36077efb752f7d76a6c61241c1d6ce16","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                    \u0027set to 0, then these actions are not taken.\u0027),"},{"line_number":43,"context_line":"    cfg.IntOpt(\u0027event_max_retries\u0027,"},{"line_number":44,"context_line":"               default\u003d1,"},{"line_number":45,"context_line":"               max\u003d3,"},{"line_number":46,"context_line":"               help\u003d\u0027Number of times to retry an event action.\u0027)"},{"line_number":47,"context_line":"]"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_0f9ea0b7","line":45,"range":{"start_line":45,"start_character":0,"end_line":45,"end_character":21},"in_reply_to":"7f96bb07_fad9d0f3","updated":"2018-01-24 04:27:34.000000000","message":"I set it 50.","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"fdd935a604b1c27d10e23fd7faf5b5a1c7ebdd1f","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                t \u003d eventlet.spawn(service_utils.with_empty_context(event_fn),"},{"line_number":156,"context_line":"                                   lease_id\u003devent[\u0027lease_id\u0027],"},{"line_number":157,"context_line":"                                   event_id\u003devent[\u0027id\u0027])"},{"line_number":158,"context_line":"                t.wait()"},{"line_number":159,"context_line":"                lease \u003d db_api.lease_get(event[\u0027lease_id\u0027])"},{"line_number":160,"context_line":"                with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as ctx:"},{"line_number":161,"context_line":"                    self._send_notification(lease,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_25f2379b","line":158,"range":{"start_line":158,"start_character":0,"end_line":158,"end_character":24},"updated":"2018-01-18 09:59:20.000000000","message":"The wait() lets _event handle all event one by one. Is it your intent? If so, it\u0027s not need to spawn a new thread.","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"9b45cd125067ef67a669c4d95799b6bdf9bd7306","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                t \u003d eventlet.spawn(service_utils.with_empty_context(event_fn),"},{"line_number":156,"context_line":"                                   lease_id\u003devent[\u0027lease_id\u0027],"},{"line_number":157,"context_line":"                                   event_id\u003devent[\u0027id\u0027])"},{"line_number":158,"context_line":"                t.wait()"},{"line_number":159,"context_line":"                lease \u003d db_api.lease_get(event[\u0027lease_id\u0027])"},{"line_number":160,"context_line":"                with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as ctx:"},{"line_number":161,"context_line":"                    self._send_notification(lease,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_759ab1c5","line":158,"range":{"start_line":158,"start_character":0,"end_line":158,"end_character":24},"in_reply_to":"7f96bb07_0e9dbe08","updated":"2018-01-23 12:20:32.000000000","message":"Separating L158-170 enables the thread to handle InvalidStatus like following.\n\ntry:\n    spawn(execute_thread, event_fn, lease_id, event_id)\nexcept Exception:\n    ...snip....\n\ndef execute_thread(self, event_fn, lease_id, event_id):\n    try:\n        event_fn(lease_id, lease_id, event_id)\n        lease \u003d db_api .... snip ....\n        return\n    except InvalidStatus:\n        .... snip ....\n        return or raise Exception\n    raise Exception\n\n\nI noticed _event() handles only one event per 10 secs.  If we have 10 events in one min, Blazar can\u0027t handle the events in the start_time.","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"5529637e130bea8b3972b6a56cfe225b65647bc0","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                t \u003d eventlet.spawn(service_utils.with_empty_context(event_fn),"},{"line_number":156,"context_line":"                                   lease_id\u003devent[\u0027lease_id\u0027],"},{"line_number":157,"context_line":"                                   event_id\u003devent[\u0027id\u0027])"},{"line_number":158,"context_line":"                t.wait()"},{"line_number":159,"context_line":"                lease \u003d db_api.lease_get(event[\u0027lease_id\u0027])"},{"line_number":160,"context_line":"                with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as ctx:"},{"line_number":161,"context_line":"                    self._send_notification(lease,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_0e9dbe08","line":158,"range":{"start_line":158,"start_character":0,"end_line":158,"end_character":24},"in_reply_to":"7f96bb07_25f2379b","updated":"2018-01-19 05:17:06.000000000","message":"I tried not to use wait() but I could not find other way to catch exceptions. I expect the event_fn basically completes much shorter than an event cycle and it\u0027s okay to handle one by one. How do you think?\n\nIf this approach is acceptable, I\u0027ll remove spawn and directly call event_fn here.","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"aceb46ef36077efb752f7d76a6c61241c1d6ce16","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                t \u003d eventlet.spawn(service_utils.with_empty_context(event_fn),"},{"line_number":156,"context_line":"                                   lease_id\u003devent[\u0027lease_id\u0027],"},{"line_number":157,"context_line":"                                   event_id\u003devent[\u0027id\u0027])"},{"line_number":158,"context_line":"                t.wait()"},{"line_number":159,"context_line":"                lease \u003d db_api.lease_get(event[\u0027lease_id\u0027])"},{"line_number":160,"context_line":"                with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as ctx:"},{"line_number":161,"context_line":"                    self._send_notification(lease,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_aff20c05","line":158,"range":{"start_line":158,"start_character":0,"end_line":158,"end_character":24},"in_reply_to":"7f96bb07_759ab1c5","updated":"2018-01-24 04:27:34.000000000","message":"Sounds good! I\u0027ve applied your proposal.\n\nAs you said, one event per 10 seconds limitation is bad. It should be changed in the future.","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"fdd935a604b1c27d10e23fd7faf5b5a1c7ebdd1f","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                        seconds\u003dCONF.manager.event_max_retries * 10):"},{"line_number":168,"context_line":"                    # Set the event status UNDONE for retrying the event"},{"line_number":169,"context_line":"                    db_api.event_update(event[\u0027id\u0027],"},{"line_number":170,"context_line":"                                        {\u0027status\u0027: status.event.UNDONE})"},{"line_number":171,"context_line":"            except Exception:"},{"line_number":172,"context_line":"                db_api.event_update(event[\u0027id\u0027],"},{"line_number":173,"context_line":"                                    {\u0027status\u0027: status.event.ERROR})"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_e57beff1","line":170,"updated":"2018-01-18 09:59:20.000000000","message":"It need to set the event status to ERROR in else block. The event will stay in INPROGRESS status retrying over the max retries.","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"8cc2b1a719eaa0b812bae4202fa549441af63ee2","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                        seconds\u003dCONF.manager.event_max_retries * 10):"},{"line_number":168,"context_line":"                    # Set the event status UNDONE for retrying the event"},{"line_number":169,"context_line":"                    db_api.event_update(event[\u0027id\u0027],"},{"line_number":170,"context_line":"                                        {\u0027status\u0027: status.event.UNDONE})"},{"line_number":171,"context_line":"            except Exception:"},{"line_number":172,"context_line":"                db_api.event_update(event[\u0027id\u0027],"},{"line_number":173,"context_line":"                                    {\u0027status\u0027: status.event.ERROR})"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_5fceb6b4","line":170,"in_reply_to":"7f96bb07_4e65061d","updated":"2018-01-23 11:21:26.000000000","message":"Sorry, I misunderstood. I\u0027ll apply your proposal.","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"5529637e130bea8b3972b6a56cfe225b65647bc0","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                        seconds\u003dCONF.manager.event_max_retries * 10):"},{"line_number":168,"context_line":"                    # Set the event status UNDONE for retrying the event"},{"line_number":169,"context_line":"                    db_api.event_update(event[\u0027id\u0027],"},{"line_number":170,"context_line":"                                        {\u0027status\u0027: status.event.UNDONE})"},{"line_number":171,"context_line":"            except Exception:"},{"line_number":172,"context_line":"                db_api.event_update(event[\u0027id\u0027],"},{"line_number":173,"context_line":"                                    {\u0027status\u0027: status.event.ERROR})"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_4e65061d","line":170,"in_reply_to":"7f96bb07_e57beff1","updated":"2018-01-19 05:17:06.000000000","message":"This is done by L171-174.","commit_id":"fe0b07455f7575c1f38a76ef24a684b6a522fbb6"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"cbfd414d741ffa7d9e9e8f5712e9d21dc57944a5","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        except common_ex.InvalidStatus:"},{"line_number":172,"context_line":"            now \u003d datetime.datetime.utcnow()"},{"line_number":173,"context_line":"            if now \u003c event[\u0027time\u0027] + datetime.timedelta("},{"line_number":174,"context_line":"                    seconds\u003dCONF.manager.event_max_retries * 10):"},{"line_number":175,"context_line":"                # Set the event status UNDONE for retrying the event"},{"line_number":176,"context_line":"                db_api.event_update(event[\u0027id\u0027],"},{"line_number":177,"context_line":"                                    {\u0027status\u0027: status.event.UNDONE})"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_eb4e6295","line":174,"range":{"start_line":174,"start_character":61,"end_line":174,"end_character":63},"updated":"2018-02-01 20:48:12.000000000","message":"Please create a constant to define the event loop period and use it at line 69 too to avoid duplicated magic numbers.","commit_id":"9f6bc1a9bf30a4e5af976a540dfe2f696f72a616"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"a032e210ab788aa752acf2d4ce1462ef62f6efc7","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        except common_ex.InvalidStatus:"},{"line_number":172,"context_line":"            now \u003d datetime.datetime.utcnow()"},{"line_number":173,"context_line":"            if now \u003c event[\u0027time\u0027] + datetime.timedelta("},{"line_number":174,"context_line":"                    seconds\u003dCONF.manager.event_max_retries * 10):"},{"line_number":175,"context_line":"                # Set the event status UNDONE for retrying the event"},{"line_number":176,"context_line":"                db_api.event_update(event[\u0027id\u0027],"},{"line_number":177,"context_line":"                                    {\u0027status\u0027: status.event.UNDONE})"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_cf512d38","line":174,"range":{"start_line":174,"start_character":61,"end_line":174,"end_character":63},"in_reply_to":"5f93b717_eb4e6295","updated":"2018-02-02 01:35:00.000000000","message":"I added a new constant EVENT_INTERVAL.","commit_id":"9f6bc1a9bf30a4e5af976a540dfe2f696f72a616"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"cbfd414d741ffa7d9e9e8f5712e9d21dc57944a5","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            else:"},{"line_number":179,"context_line":"                db_api.event_update(event[\u0027id\u0027],"},{"line_number":180,"context_line":"                                    {\u0027status\u0027: status.event.ERROR})"},{"line_number":181,"context_line":"                LOG.exception(\u0027Error occurred while event handling.\u0027)"},{"line_number":182,"context_line":"        except Exception:"},{"line_number":183,"context_line":"            db_api.event_update(event[\u0027id\u0027],"},{"line_number":184,"context_line":"                                {\u0027status\u0027: status.event.ERROR})"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_0b52ae3b","line":181,"range":{"start_line":181,"start_character":46,"end_line":181,"end_character":66},"updated":"2018-02-01 20:48:12.000000000","message":"either use:\n\n    while handling event\n\nor:\n\n    during event handling","commit_id":"9f6bc1a9bf30a4e5af976a540dfe2f696f72a616"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"a032e210ab788aa752acf2d4ce1462ef62f6efc7","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            else:"},{"line_number":179,"context_line":"                db_api.event_update(event[\u0027id\u0027],"},{"line_number":180,"context_line":"                                    {\u0027status\u0027: status.event.ERROR})"},{"line_number":181,"context_line":"                LOG.exception(\u0027Error occurred while event handling.\u0027)"},{"line_number":182,"context_line":"        except Exception:"},{"line_number":183,"context_line":"            db_api.event_update(event[\u0027id\u0027],"},{"line_number":184,"context_line":"                                {\u0027status\u0027: status.event.ERROR})"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_6f449974","line":181,"range":{"start_line":181,"start_character":46,"end_line":181,"end_character":66},"in_reply_to":"5f93b717_0b52ae3b","updated":"2018-02-02 01:35:00.000000000","message":"Done","commit_id":"9f6bc1a9bf30a4e5af976a540dfe2f696f72a616"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"cbfd414d741ffa7d9e9e8f5712e9d21dc57944a5","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        except Exception:"},{"line_number":183,"context_line":"            db_api.event_update(event[\u0027id\u0027],"},{"line_number":184,"context_line":"                                {\u0027status\u0027: status.event.ERROR})"},{"line_number":185,"context_line":"            LOG.exception(\u0027Error occurred while event handling.\u0027)"},{"line_number":186,"context_line":"        else:"},{"line_number":187,"context_line":"            lease \u003d db_api.lease_get(event[\u0027lease_id\u0027])"},{"line_number":188,"context_line":"            with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as ctx:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_8b5d5e48","line":185,"range":{"start_line":185,"start_character":42,"end_line":185,"end_character":62},"updated":"2018-02-01 20:48:12.000000000","message":"either use:\n\n    while handling event\n\nor:\n\n    during event handling","commit_id":"9f6bc1a9bf30a4e5af976a540dfe2f696f72a616"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"a032e210ab788aa752acf2d4ce1462ef62f6efc7","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        except Exception:"},{"line_number":183,"context_line":"            db_api.event_update(event[\u0027id\u0027],"},{"line_number":184,"context_line":"                                {\u0027status\u0027: status.event.ERROR})"},{"line_number":185,"context_line":"            LOG.exception(\u0027Error occurred while event handling.\u0027)"},{"line_number":186,"context_line":"        else:"},{"line_number":187,"context_line":"            lease \u003d db_api.lease_get(event[\u0027lease_id\u0027])"},{"line_number":188,"context_line":"            with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as ctx:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_8f47a577","line":185,"range":{"start_line":185,"start_character":42,"end_line":185,"end_character":62},"in_reply_to":"5f93b717_8b5d5e48","updated":"2018-02-02 01:35:00.000000000","message":"Done","commit_id":"9f6bc1a9bf30a4e5af976a540dfe2f696f72a616"}]}
