)]}'
{"networking_odl/db/db.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"67fe2b8d7df3b98e51bc879037844a7bad91849f","unresolved":false,"context_lines":[{"line_number":33,"context_line":"_retry_db_errors \u003d oslo_db_api.wrap_db_retry("},{"line_number":34,"context_line":"    max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":35,"context_line":"    exception_checker\u003ddb_api.is_retriable"},{"line_number":36,"context_line":")"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def get_pending_or_processing_ops(session, object_uuid, operation\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_c101a906","line":36,"updated":"2017-09-05 04:33:47.000000000","message":"what\u0027s wrong with db_api.retry_db_errors?","commit_id":"35f5ad9c10d76d73bbba89c4fbcb92301e021741"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"67fe2b8d7df3b98e51bc879037844a7bad91849f","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    session.expire_all()"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"@_retry_db_errors"},{"line_number":109,"context_line":"def update_db_row_state(session, row, state, flush\u003dTrue):"},{"line_number":110,"context_line":"    row.state \u003d state"},{"line_number":111,"context_line":"    session.merge(row)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_a121fda1","line":108,"updated":"2017-09-05 04:33:47.000000000","message":"i don\u0027t think it makes sense to retry in the middle of a transaction.","commit_id":"35f5ad9c10d76d73bbba89c4fbcb92301e021741"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"e62e4682f34c5087d557b4632a2a82aa0b93bf1c","unresolved":false,"context_lines":[{"line_number":137,"context_line":"            session.flush()"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"@_retry_if_session_inactive"},{"line_number":141,"context_line":"def create_pending_row(session, object_type, object_uuid,"},{"line_number":142,"context_line":"                       operation, data, depending_on\u003dNone):"},{"line_number":143,"context_line":"    if depending_on is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f2577a7_5a543b21","line":140,"range":{"start_line":140,"start_character":0,"end_line":140,"end_character":27},"updated":"2017-09-15 01:13:11.000000000","message":"The contract is that this method is called under db transaction.\nSo this doesn\u0027t make sense. this decorator can be removed.\n\nIf necessary, we can fix unit tests which wrongly calls this method.","commit_id":"eaec1f5aee125466005f2e6944f7ac91a4cb3d88"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"051e30a2eca13017a0fda92471ae0c51aff26178","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"# TODO(mpeterson): Since the current implementation of retry_db_errors in"},{"line_number":37,"context_line":"# neutron.db.api does a deepcopy on the arguments, it does not gracefully"},{"line_number":38,"context_line":"# handle the situation where the object being passed is bound to a session"},{"line_number":39,"context_line":"# this will be changed in the future as enginefacade replaces legacy patterns"},{"line_number":40,"context_line":"# and then we need to go back to use the decorators provided for us."},{"line_number":41,"context_line":"def retry_db_errors(f):"},{"line_number":42,"context_line":"    @db_api._tag_retriables_as_unretriable"},{"line_number":43,"context_line":"    @db_api._retry_db_errors"},{"line_number":44,"context_line":"    @six.wraps(f)"},{"line_number":45,"context_line":"    def wrapped(*args, **kwargs):"},{"line_number":46,"context_line":"        try:"},{"line_number":47,"context_line":"            return f(*args, **kwargs)"},{"line_number":48,"context_line":"        except Exception as e:"},{"line_number":49,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":50,"context_line":"                if db_api.is_retriable(e):"},{"line_number":51,"context_line":"                    LOG.debug(\"Retry wrapper got retriable exception: %s\", e)"},{"line_number":52,"context_line":"    return wrapped"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def retry_if_session_inactive(db_object_var_name\u003d\u0027context\u0027):"},{"line_number":56,"context_line":"    def decorator(f):"},{"line_number":57,"context_line":"        try:"},{"line_number":58,"context_line":"            arg_index \u003d p_util.getargspec(f).args.index(db_object_var_name)"},{"line_number":59,"context_line":"        except ValueError:"},{"line_number":60,"context_line":"            raise RuntimeError(_(\"Could not find position of var %s\") %"},{"line_number":61,"context_line":"                               db_object_var_name)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        f_with_retry \u003d retry_db_errors(f)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        @six.wraps(f)"},{"line_number":66,"context_line":"        def wrapped(*args, **kwargs):"},{"line_number":67,"context_line":"            if db_object_var_name in kwargs:"},{"line_number":68,"context_line":"                db_object \u003d kwargs[db_object_var_name]"},{"line_number":69,"context_line":"            else:"},{"line_number":70,"context_line":"                db_object \u003d args[arg_index]"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"            session \u003d (db_object.session"},{"line_number":73,"context_line":"                       if isinstance(db_object, db_context.Context) else"},{"line_number":74,"context_line":"                       db_object)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"            method \u003d f if session.is_active else f_with_retry"},{"line_number":77,"context_line":"            return method(*args, **kwargs)"},{"line_number":78,"context_line":"        return wrapped"},{"line_number":79,"context_line":"    return decorator"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"def get_pending_or_processing_ops(session, object_uuid, operation\u003dNone):"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f4e5783_f5973b47","line":79,"range":{"start_line":35,"start_character":0,"end_line":79,"end_character":20},"updated":"2017-10-17 11:13:18.000000000","message":"This is not necessary..\n\nAll callers of the decorated methods (that you didn\u0027t extract from this module) have a context anyway, so you could similarly extract the transaction handling to separate methods in the respective places and use the regular decorators there that accept a context.\n\nThe only exception I see is update_pending_db_row_retry(session, row, retry_count) which can be adjusted rather easily to receive a row ID and fetch the row in question before updating it\u0027s state (to avoid deepcopying the row)..\n\nThis solution seems simpler and more elgant to me..","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d7fb67494eeef85049542f2840000c7f95d55c19","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"# TODO(mpeterson): Since the current implementation of retry_db_errors in"},{"line_number":37,"context_line":"# neutron.db.api does a deepcopy on the arguments, it does not gracefully"},{"line_number":38,"context_line":"# handle the situation where the object being passed is bound to a session"},{"line_number":39,"context_line":"# this will be changed in the future as enginefacade replaces legacy patterns"},{"line_number":40,"context_line":"# and then we need to go back to use the decorators provided for us."},{"line_number":41,"context_line":"def retry_db_errors(f):"},{"line_number":42,"context_line":"    @db_api._tag_retriables_as_unretriable"},{"line_number":43,"context_line":"    @db_api._retry_db_errors"},{"line_number":44,"context_line":"    @six.wraps(f)"},{"line_number":45,"context_line":"    def wrapped(*args, **kwargs):"},{"line_number":46,"context_line":"        try:"},{"line_number":47,"context_line":"            return f(*args, **kwargs)"},{"line_number":48,"context_line":"        except Exception as e:"},{"line_number":49,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":50,"context_line":"                if db_api.is_retriable(e):"},{"line_number":51,"context_line":"                    LOG.debug(\"Retry wrapper got retriable exception: %s\", e)"},{"line_number":52,"context_line":"    return wrapped"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def retry_if_session_inactive(db_object_var_name\u003d\u0027context\u0027):"},{"line_number":56,"context_line":"    def decorator(f):"},{"line_number":57,"context_line":"        try:"},{"line_number":58,"context_line":"            arg_index \u003d p_util.getargspec(f).args.index(db_object_var_name)"},{"line_number":59,"context_line":"        except ValueError:"},{"line_number":60,"context_line":"            raise RuntimeError(_(\"Could not find position of var %s\") %"},{"line_number":61,"context_line":"                               db_object_var_name)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        f_with_retry \u003d retry_db_errors(f)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        @six.wraps(f)"},{"line_number":66,"context_line":"        def wrapped(*args, **kwargs):"},{"line_number":67,"context_line":"            if db_object_var_name in kwargs:"},{"line_number":68,"context_line":"                db_object \u003d kwargs[db_object_var_name]"},{"line_number":69,"context_line":"            else:"},{"line_number":70,"context_line":"                db_object \u003d args[arg_index]"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"            session \u003d (db_object.session"},{"line_number":73,"context_line":"                       if isinstance(db_object, db_context.Context) else"},{"line_number":74,"context_line":"                       db_object)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"            method \u003d f if session.is_active else f_with_retry"},{"line_number":77,"context_line":"            return method(*args, **kwargs)"},{"line_number":78,"context_line":"        return wrapped"},{"line_number":79,"context_line":"    return decorator"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"def get_pending_or_processing_ops(session, object_uuid, operation\u003dNone):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_6e7a2089","line":79,"range":{"start_line":35,"start_character":0,"end_line":79,"end_character":20},"in_reply_to":"5f4e5783_f5973b47","updated":"2017-10-18 11:42:33.000000000","message":"I\u0027ll modify it.","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"}],"networking_odl/journal/cleanup.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0ca87d3754ffd774b61acc0966402ef049b90db8","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":47,"context_line":"            row_count \u003d db.reset_processing_rows("},{"line_number":48,"context_line":"                context.session, self._processing_timeout)"},{"line_number":49,"context_line":"            if row_count:"},{"line_number":50,"context_line":"                LOG.info(\"Reset %(num)s orphaned rows back to pending\","},{"line_number":51,"context_line":"                         {\"num\": row_count})"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f2f7f8d_2b9e5907","line":51,"range":{"start_line":49,"start_character":0,"end_line":51,"end_character":44},"updated":"2017-09-19 00:50:01.000000000","message":"this logging should be after committing db transaction.\ni.e. out of the with statement.","commit_id":"918e82a21236069df87ab1ec9bde4184851852bf"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"61de22f2faf86d00ecd9ecbb8c808275dfc9db5f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":47,"context_line":"            row_count \u003d db.reset_processing_rows("},{"line_number":48,"context_line":"                context.session, self._processing_timeout)"},{"line_number":49,"context_line":"            if row_count:"},{"line_number":50,"context_line":"                LOG.info(\"Reset %(num)s orphaned rows back to pending\","},{"line_number":51,"context_line":"                         {\"num\": row_count})"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f515b1d_a44545b6","line":51,"range":{"start_line":49,"start_character":0,"end_line":51,"end_character":44},"in_reply_to":"1f2f7f8d_2b9e5907","updated":"2017-10-09 17:31:01.000000000","message":"Done","commit_id":"918e82a21236069df87ab1ec9bde4184851852bf"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":36,"context_line":"    def delete_completed_rows(self, context):"},{"line_number":37,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":38,"context_line":"            if self._rows_retention !\u003d -1:"},{"line_number":39,"context_line":"                LOG.debug(\"Deleting completed rows\")"},{"line_number":40,"context_line":"                db.delete_rows_by_state_and_time("}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_0e1c4f76","line":37,"range":{"start_line":37,"start_character":0,"end_line":37,"end_character":60},"updated":"2017-10-24 01:50:39.000000000","message":"If we\u0027d like to start transaction, this should be inside if clause.","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d14daa15957f5fe7981b1d039ccb9656f08a3b0d","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":36,"context_line":"    def delete_completed_rows(self, context):"},{"line_number":37,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":38,"context_line":"            if self._rows_retention !\u003d -1:"},{"line_number":39,"context_line":"                LOG.debug(\"Deleting completed rows\")"},{"line_number":40,"context_line":"                db.delete_rows_by_state_and_time("}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_a0b09f44","line":37,"range":{"start_line":37,"start_character":0,"end_line":37,"end_character":60},"in_reply_to":"3f4b6375_0e1c4f76","updated":"2017-10-25 09:40:32.000000000","message":"Done","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":38,"context_line":"            if self._rows_retention !\u003d -1:"},{"line_number":39,"context_line":"                LOG.debug(\"Deleting completed rows\")"},{"line_number":40,"context_line":"                db.delete_rows_by_state_and_time("},{"line_number":41,"context_line":"                    context.session, odl_const.COMPLETED,"},{"line_number":42,"context_line":"                    timedelta(seconds\u003dself._rows_retention))"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_8e0f1f36","line":40,"range":{"start_line":40,"start_character":19,"end_line":40,"end_character":48},"updated":"2017-10-24 01:50:39.000000000","message":"This method also starts transaction. So caller or callee should start transaction?","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d14daa15957f5fe7981b1d039ccb9656f08a3b0d","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":38,"context_line":"            if self._rows_retention !\u003d -1:"},{"line_number":39,"context_line":"                LOG.debug(\"Deleting completed rows\")"},{"line_number":40,"context_line":"                db.delete_rows_by_state_and_time("},{"line_number":41,"context_line":"                    context.session, odl_const.COMPLETED,"},{"line_number":42,"context_line":"                    timedelta(seconds\u003dself._rows_retention))"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_8096c392","line":40,"range":{"start_line":40,"start_character":19,"end_line":40,"end_character":48},"in_reply_to":"3f4b6375_8e0f1f36","updated":"2017-10-25 09:40:32.000000000","message":"I think it\u0027s quite alright that caller and callee both start a transaction. The callee needs to start a transaction to atomize it\u0027s operations and caller needs to do it to (a) protect the operation of possible errors and (b) also atomize what it does.\n\nI see no problem whatsoever to start two transactions and it\u0027s actually a pattern that you can see encouraged in the SQLAlchemy documentation.","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":45,"context_line":"    def cleanup_processing_rows(self, context):"},{"line_number":46,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":47,"context_line":"            row_count \u003d db.reset_processing_rows("},{"line_number":48,"context_line":"                context.session, self._processing_timeout)"},{"line_number":49,"context_line":"        if row_count:"},{"line_number":50,"context_line":"            LOG.info(\"Reset %(num)s orphaned rows back to pending\","}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_a90bf521","line":47,"range":{"start_line":47,"start_character":0,"end_line":47,"end_character":48},"updated":"2017-10-24 01:50:39.000000000","message":"ditto.","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d14daa15957f5fe7981b1d039ccb9656f08a3b0d","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":45,"context_line":"    def cleanup_processing_rows(self, context):"},{"line_number":46,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":47,"context_line":"            row_count \u003d db.reset_processing_rows("},{"line_number":48,"context_line":"                context.session, self._processing_timeout)"},{"line_number":49,"context_line":"        if row_count:"},{"line_number":50,"context_line":"            LOG.info(\"Reset %(num)s orphaned rows back to pending\","}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_20eb8f13","line":47,"range":{"start_line":47,"start_character":0,"end_line":47,"end_character":48},"in_reply_to":"3f4b6375_a90bf521","updated":"2017-10-25 09:40:32.000000000","message":"ditto","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"}],"networking_odl/journal/journal.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0ca87d3754ffd774b61acc0966402ef049b90db8","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    def _retry_reset(self):"},{"line_number":253,"context_line":"        self._sleep_time \u003d self._RETRY_SLEEP_MIN"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    @staticmethod"},{"line_number":256,"context_line":"    @db.retry_db_errors"},{"line_number":257,"context_line":"    def _entry_reset(session, entry):"},{"line_number":258,"context_line":"        with db_api.autonested_transaction(session):"},{"line_number":259,"context_line":"            db.update_db_row_state(session, entry, odl_const.PENDING)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def _sync_entry(self, context, entry):"},{"line_number":262,"context_line":"        log_dict \u003d {\u0027op\u0027: entry.operation, \u0027type\u0027: entry.object_type,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f2f7f8d_2b6c1907","line":259,"range":{"start_line":255,"start_character":0,"end_line":259,"end_character":69},"updated":"2017-09-19 00:50:01.000000000","message":"Please be consistent to be function or static method.\nentry_complete is function and _entry_reset is method.","commit_id":"918e82a21236069df87ab1ec9bde4184851852bf"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"61de22f2faf86d00ecd9ecbb8c808275dfc9db5f","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    def _retry_reset(self):"},{"line_number":253,"context_line":"        self._sleep_time \u003d self._RETRY_SLEEP_MIN"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    @staticmethod"},{"line_number":256,"context_line":"    @db.retry_db_errors"},{"line_number":257,"context_line":"    def _entry_reset(session, entry):"},{"line_number":258,"context_line":"        with db_api.autonested_transaction(session):"},{"line_number":259,"context_line":"            db.update_db_row_state(session, entry, odl_const.PENDING)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def _sync_entry(self, context, entry):"},{"line_number":262,"context_line":"        log_dict \u003d {\u0027op\u0027: entry.operation, \u0027type\u0027: entry.object_type,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f515b1d_6432ad12","line":259,"range":{"start_line":255,"start_character":0,"end_line":259,"end_character":69},"in_reply_to":"1f2f7f8d_2b6c1907","updated":"2017-10-09 17:31:01.000000000","message":"Done","commit_id":"918e82a21236069df87ab1ec9bde4184851852bf"}],"networking_odl/journal/recovery.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0ca87d3754ffd774b61acc0966402ef049b90db8","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                                               odl_const.FAILED):"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                LOG.debug(\"Attempting recovery of journal entry %s.\", row)"},{"line_number":46,"context_line":"                odl_resource \u003d _CLIENT.get_client().get_resource("},{"line_number":47,"context_line":"                    row.object_type,"},{"line_number":48,"context_line":"                    row.object_uuid)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"                if odl_resource is not None:"},{"line_number":51,"context_line":"                    _handle_existing_resource(context, row)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f2f7f8d_eb5e1144","line":48,"range":{"start_line":46,"start_character":0,"end_line":48,"end_character":36},"updated":"2017-09-19 00:50:01.000000000","message":"we shouldn\u0027t call a method which may call non-deterministicly long time within db transaction. i.e. rest call to ODL","commit_id":"918e82a21236069df87ab1ec9bde4184851852bf"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"61de22f2faf86d00ecd9ecbb8c808275dfc9db5f","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                                               odl_const.FAILED):"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                LOG.debug(\"Attempting recovery of journal entry %s.\", row)"},{"line_number":46,"context_line":"                odl_resource \u003d _CLIENT.get_client().get_resource("},{"line_number":47,"context_line":"                    row.object_type,"},{"line_number":48,"context_line":"                    row.object_uuid)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"                if odl_resource is not None:"},{"line_number":51,"context_line":"                    _handle_existing_resource(context, row)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f515b1d_a34c149e","line":48,"range":{"start_line":46,"start_character":0,"end_line":48,"end_character":36},"in_reply_to":"1f2f7f8d_eb5e1144","updated":"2017-10-09 17:31:01.000000000","message":"Done","commit_id":"918e82a21236069df87ab1ec9bde4184851852bf"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"051e30a2eca13017a0fda92471ae0c51aff26178","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            LOG.warning(\u0027Unsupported resource %s\u0027, row.object_type)"},{"line_number":50,"context_line":"        except Exception as e:"},{"line_number":51,"context_line":"            with excutils.save_and_reraise_exception() as ctx:"},{"line_number":52,"context_line":"                if not db_api.is_retriable(e):"},{"line_number":53,"context_line":"                    ctx.reraise \u003d False"},{"line_number":54,"context_line":"                    LOG.exception("},{"line_number":55,"context_line":"                        \"Failure while recovering journal entry %s.\", row)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f4e5783_7bd5ace4","line":52,"range":{"start_line":52,"start_character":16,"end_line":52,"end_character":45},"updated":"2017-10-17 11:13:18.000000000","message":"What\u0027s the importance of this here?\n\nThis is a call to the ODL controller, so why would a \"DB retriable\" exception ever pop up?\n\nPerhaps I\u0027m missing some valid reason in which case a comment is needed wince it\u0027s not clear why you expect this to happen here..","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d7fb67494eeef85049542f2840000c7f95d55c19","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            LOG.warning(\u0027Unsupported resource %s\u0027, row.object_type)"},{"line_number":50,"context_line":"        except Exception as e:"},{"line_number":51,"context_line":"            with excutils.save_and_reraise_exception() as ctx:"},{"line_number":52,"context_line":"                if not db_api.is_retriable(e):"},{"line_number":53,"context_line":"                    ctx.reraise \u003d False"},{"line_number":54,"context_line":"                    LOG.exception("},{"line_number":55,"context_line":"                        \"Failure while recovering journal entry %s.\", row)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_6bd69252","line":52,"range":{"start_line":52,"start_character":16,"end_line":52,"end_character":45},"in_reply_to":"5f4e5783_7bd5ace4","updated":"2017-10-18 11:42:33.000000000","message":"Oops forgot to change this from the previous patch set where the retry also included the DB calls.","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"}],"networking_odl/tests/unit/db/test_db.py":[{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"051e30a2eca13017a0fda92471ae0c51aff26178","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def setUp(self):"},{"line_number":35,"context_line":"        super(DbTestCase, self).setUp()"},{"line_number":36,"context_line":"        # NOTE(mpeterson): this is a workaround to a problem in pecan lib"},{"line_number":37,"context_line":"        # goes with `_decorated_function`"},{"line_number":38,"context_line":"        self._mock_function \u003d mock.MagicMock()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _update_row(self, row):"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f4e5783_0cdc2ee2","line":37,"range":{"start_line":36,"start_character":10,"end_line":37,"end_character":41},"updated":"2017-10-17 11:13:18.000000000","message":"I\u0027m not sure I understand what this means, is there some reference or some clarification you can give?","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d7fb67494eeef85049542f2840000c7f95d55c19","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def setUp(self):"},{"line_number":35,"context_line":"        super(DbTestCase, self).setUp()"},{"line_number":36,"context_line":"        # NOTE(mpeterson): this is a workaround to a problem in pecan lib"},{"line_number":37,"context_line":"        # goes with `_decorated_function`"},{"line_number":38,"context_line":"        self._mock_function \u003d mock.MagicMock()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _update_row(self, row):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_0e696cbd","line":37,"range":{"start_line":36,"start_character":10,"end_line":37,"end_character":41},"in_reply_to":"5f4e5783_0cdc2ee2","updated":"2017-10-18 11:42:33.000000000","message":"I\u0027ll clarify this comment.","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"}],"networking_odl/tests/unit/journal/test_cleanup.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class JournalCleanupTestCase(test_base_db.ODLBaseDbTestCase):"},{"line_number":25,"context_line":"    def _journal_cleanup_object(self, retention):"},{"line_number":26,"context_line":"        self.cfg.config(completed_rows_retention\u003dretention, group\u003d\u0027ml2_odl\u0027)"},{"line_number":27,"context_line":"        return JournalCleanup()"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def test_delete_completed_rows_retries_exceptions(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_295ee511","line":26,"range":{"start_line":26,"start_character":17,"end_line":26,"end_character":23},"updated":"2017-10-24 01:50:39.000000000","message":"set_override","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d14daa15957f5fe7981b1d039ccb9656f08a3b0d","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class JournalCleanupTestCase(test_base_db.ODLBaseDbTestCase):"},{"line_number":25,"context_line":"    def _journal_cleanup_object(self, retention):"},{"line_number":26,"context_line":"        self.cfg.config(completed_rows_retention\u003dretention, group\u003d\u0027ml2_odl\u0027)"},{"line_number":27,"context_line":"        return JournalCleanup()"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def test_delete_completed_rows_retries_exceptions(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_20914f48","line":26,"range":{"start_line":26,"start_character":17,"end_line":26,"end_character":23},"in_reply_to":"3f4b6375_295ee511","updated":"2017-10-25 09:40:32.000000000","message":"Actually config is a helper of set_override to make it easier to express as key-values. Still is a common comment I see you make. Care to enlighten me?\n\n\nhttps://github.com/openstack/oslo.config/blob/master/oslo_config/fixture.py#L56","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"}],"networking_odl/tests/unit/journal/test_journal.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        entry \u003d db.get_all_db_rows(self.db_session)[-1]"},{"line_number":104,"context_line":"        journal.entry_complete(self.db_context, entry)"},{"line_number":105,"context_line":"        rows \u003d db.get_all_db_rows(self.db_session)"},{"line_number":106,"context_line":"        self.assertEqual(expected_entries, len(rows))"},{"line_number":107,"context_line":"        self.assertTrue("},{"line_number":108,"context_line":"            all(row.state \u003d\u003d odl_const.COMPLETED for row in rows))"},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_7b202049","line":106,"range":{"start_line":106,"start_character":33,"end_line":106,"end_character":41},"updated":"2017-10-24 01:50:39.000000000","message":"Oh, this is length. not actual entries.\nPlease rename it to express it.","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d14daa15957f5fe7981b1d039ccb9656f08a3b0d","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        entry \u003d db.get_all_db_rows(self.db_session)[-1]"},{"line_number":104,"context_line":"        journal.entry_complete(self.db_context, entry)"},{"line_number":105,"context_line":"        rows \u003d db.get_all_db_rows(self.db_session)"},{"line_number":106,"context_line":"        self.assertEqual(expected_entries, len(rows))"},{"line_number":107,"context_line":"        self.assertTrue("},{"line_number":108,"context_line":"            all(row.state \u003d\u003d odl_const.COMPLETED for row in rows))"},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_a04c1f42","line":106,"range":{"start_line":106,"start_character":33,"end_line":106,"end_character":41},"in_reply_to":"3f4b6375_7b202049","updated":"2017-10-25 09:40:32.000000000","message":"Done","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        dependant \u003d db.get_all_db_rows(self.db_session)[-1]"},{"line_number":125,"context_line":"        journal.entry_complete(self.db_context, entry)"},{"line_number":126,"context_line":"        rows \u003d db.get_all_db_rows(self.db_session)"},{"line_number":127,"context_line":"        self.assertTrue(entry in rows)"},{"line_number":128,"context_line":"        self.assertEqual([], entry.dependencies)"},{"line_number":129,"context_line":"        self.assertEqual([], dependant.depending_on)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_dbda7449","line":127,"range":{"start_line":127,"start_character":13,"end_line":127,"end_character":23},"updated":"2017-10-24 01:50:39.000000000","message":"assertIn","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d14daa15957f5fe7981b1d039ccb9656f08a3b0d","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        dependant \u003d db.get_all_db_rows(self.db_session)[-1]"},{"line_number":125,"context_line":"        journal.entry_complete(self.db_context, entry)"},{"line_number":126,"context_line":"        rows \u003d db.get_all_db_rows(self.db_session)"},{"line_number":127,"context_line":"        self.assertTrue(entry in rows)"},{"line_number":128,"context_line":"        self.assertEqual([], entry.dependencies)"},{"line_number":129,"context_line":"        self.assertEqual([], dependant.depending_on)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_6052a7e0","line":127,"range":{"start_line":127,"start_character":13,"end_line":127,"end_character":23},"in_reply_to":"3f4b6375_dbda7449","updated":"2017-10-25 09:40:32.000000000","message":"Done","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"}],"networking_odl/tests/unit/test_base_db.py":[{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"051e30a2eca13017a0fda92471ae0c51aff26178","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                return"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"            exc_names \u003d (tuple(exc.__name__ for exc in exceptions)"},{"line_number":102,"context_line":"                         if hasattr(exceptions, \u0027__iter__\u0027) else"},{"line_number":103,"context_line":"                         exceptions.__name__)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"            self.fail(\u0027%s did not raise %s\u0027 % (method.__name__, exc_names))"},{"line_number":106,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5f4e5783_b0f0ccfe","line":103,"range":{"start_line":102,"start_character":25,"end_line":103,"end_character":45},"updated":"2017-10-17 11:13:18.000000000","message":"Why is this necessary?\nYou seem to always send a tuple to this method.","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d7fb67494eeef85049542f2840000c7f95d55c19","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                return"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"            exc_names \u003d (tuple(exc.__name__ for exc in exceptions)"},{"line_number":102,"context_line":"                         if hasattr(exceptions, \u0027__iter__\u0027) else"},{"line_number":103,"context_line":"                         exceptions.__name__)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"            self.fail(\u0027%s did not raise %s\u0027 % (method.__name__, exc_names))"},{"line_number":106,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_eb460222","line":103,"range":{"start_line":102,"start_character":25,"end_line":103,"end_character":45},"in_reply_to":"5f4e5783_b0f0ccfe","updated":"2017-10-18 11:42:33.000000000","message":"This is to respect the `assertRises(...)` interface, which accepts either a list or just one `Exception`","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"051e30a2eca13017a0fda92471ae0c51aff26178","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"            self.fail(\u0027%s did not raise %s\u0027 % (method.__name__, exc_names))"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        try:"},{"line_number":108,"context_line":"            raise _InnerException"},{"line_number":109,"context_line":"        except _InnerException as e:"},{"line_number":110,"context_line":"            _e \u003d e"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        expected_retries \u003d 2 if expect_retries else 0"},{"line_number":113,"context_line":"        db_object \u003d self.db_context if receives_context else self.db_session"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f4e5783_c6affb27","line":110,"range":{"start_line":107,"start_character":8,"end_line":110,"end_character":18},"updated":"2017-10-17 11:13:18.000000000","message":"What\u0027s the purpose of this code? To instantiate an _InnerException object?","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"            self.fail(\u0027%s did not raise %s\u0027 % (method.__name__, exc_names))"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        try:"},{"line_number":108,"context_line":"            raise _InnerException"},{"line_number":109,"context_line":"        except _InnerException as e:"},{"line_number":110,"context_line":"            _e \u003d e"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        expected_retries \u003d 2 if expect_retries else 0"},{"line_number":113,"context_line":"        db_object \u003d self.db_context if receives_context else self.db_session"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_7b3a60cc","line":110,"range":{"start_line":107,"start_character":8,"end_line":110,"end_character":18},"in_reply_to":"3f4b6375_0b739e82","updated":"2017-10-24 01:50:39.000000000","message":"Can you please add a comment so.\nIt\u0027s difficult to guess so from source code\n.","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d7fb67494eeef85049542f2840000c7f95d55c19","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"            self.fail(\u0027%s did not raise %s\u0027 % (method.__name__, exc_names))"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        try:"},{"line_number":108,"context_line":"            raise _InnerException"},{"line_number":109,"context_line":"        except _InnerException as e:"},{"line_number":110,"context_line":"            _e \u003d e"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        expected_retries \u003d 2 if expect_retries else 0"},{"line_number":113,"context_line":"        db_object \u003d self.db_context if receives_context else self.db_session"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_0b739e82","line":110,"range":{"start_line":107,"start_character":8,"end_line":110,"end_character":18},"in_reply_to":"5f4e5783_c6affb27","updated":"2017-10-18 11:42:33.000000000","message":"Because we need an instantiated Exception WITH a Traceback. This is the most natural way to do it.","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"051e30a2eca13017a0fda92471ae0c51aff26178","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        expected_retries \u003d 2 if expect_retries else 0"},{"line_number":113,"context_line":"        db_object \u003d self.db_context if receives_context else self.db_session"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        for exception in exceptions:"},{"line_number":116,"context_line":"            mock_object.side_effect \u003d exception(_e)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"            _assertRaises((exception, _InnerException), method,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f4e5783_46c42bf5","line":115,"range":{"start_line":115,"start_character":12,"end_line":115,"end_character":21},"updated":"2017-10-17 11:13:18.000000000","message":"This isn\u0027t used.\n\nWas this on purpose?","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d7fb67494eeef85049542f2840000c7f95d55c19","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        expected_retries \u003d 2 if expect_retries else 0"},{"line_number":113,"context_line":"        db_object \u003d self.db_context if receives_context else self.db_session"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        for exception in exceptions:"},{"line_number":116,"context_line":"            mock_object.side_effect \u003d exception(_e)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"            _assertRaises((exception, _InnerException), method,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_4b0e36e6","line":115,"range":{"start_line":115,"start_character":12,"end_line":115,"end_character":21},"in_reply_to":"5f4e5783_46c42bf5","updated":"2017-10-18 11:42:33.000000000","message":"L116 and L118 :)","commit_id":"03c24d681dd91c80cbaf9cc458a26f529cdfd4af"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"RETRIABLE_EXCEPTIONS \u003d (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":35,"context_line":"                        db_exc.DBConnectionError, db_exc.DBDuplicateEntry,"},{"line_number":36,"context_line":"                        db_exc.RetryRequest)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class _InnerException(Exception):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_9b4cfc42","line":36,"range":{"start_line":36,"start_character":44,"end_line":36,"end_character":44},"updated":"2017-10-24 01:50:39.000000000","message":"NeutronDbObjectDuplicateEntry?\nthis should match is_retriable(), right?","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d14daa15957f5fe7981b1d039ccb9656f08a3b0d","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"RETRIABLE_EXCEPTIONS \u003d (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":35,"context_line":"                        db_exc.DBConnectionError, db_exc.DBDuplicateEntry,"},{"line_number":36,"context_line":"                        db_exc.RetryRequest)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class _InnerException(Exception):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_8072437a","line":36,"range":{"start_line":36,"start_character":44,"end_line":36,"end_character":44},"in_reply_to":"3f4b6375_9b4cfc42","updated":"2017-10-25 09:40:32.000000000","message":"no, it\u0027s a neutron specific exception. Not likely to happen down neutron.","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.db_context \u003d context.get_admin_context()"},{"line_number":47,"context_line":"        self.db_session \u003d self.db_context.session"},{"line_number":48,"context_line":"        self.addCleanup(self._db_cleanup)"},{"line_number":49,"context_line":"        self.cfg \u003d self.useFixture(config_fixture.Config())"},{"line_number":50,"context_line":"        self.cfg.config(completed_rows_retention\u003d-1, group\u003d\u0027ml2_odl\u0027)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def _db_cleanup(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_a9a7750b","line":49,"range":{"start_line":49,"start_character":18,"end_line":49,"end_character":59},"updated":"2017-10-24 01:50:39.000000000","message":"Oh, you\u0027re using config fixuture here. So set method makes sense.","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        except _InnerException as e:"},{"line_number":110,"context_line":"            _e \u003d e"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        expected_retries \u003d 2 if expect_retries else 0"},{"line_number":113,"context_line":"        db_object \u003d self.db_context if receives_context else self.db_session"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        for exception in exceptions:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_db0cb4ed","line":112,"range":{"start_line":112,"start_character":27,"end_line":112,"end_character":28},"updated":"2017-10-24 01:50:39.000000000","message":"This comes from line 65, right?","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d14daa15957f5fe7981b1d039ccb9656f08a3b0d","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        except _InnerException as e:"},{"line_number":110,"context_line":"            _e \u003d e"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        expected_retries \u003d 2 if expect_retries else 0"},{"line_number":113,"context_line":"        db_object \u003d self.db_context if receives_context else self.db_session"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        for exception in exceptions:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_c02a7b2a","line":112,"range":{"start_line":112,"start_character":27,"end_line":112,"end_character":28},"in_reply_to":"3f4b6375_db0cb4ed","updated":"2017-10-25 09:40:32.000000000","message":"Done","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2eb1849762b1f88ffe11b44258d863f0fdd92bea","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            # NOTE(mpeterson): RETRIABLE * 3 when expect_retries\u003dTrue since"},{"line_number":133,"context_line":"            # it will retry twice as per the test, plus the original call."},{"line_number":134,"context_line":"            if assert_begin_transaction:"},{"line_number":135,"context_line":"                self.assertEqual(m.call_count, len(RETRIABLE_EXCEPTIONS) * 3)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"            if receives_context:"},{"line_number":138,"context_line":"                with self.db_session.begin():"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_7bc4a091","line":135,"range":{"start_line":135,"start_character":75,"end_line":135,"end_character":76},"updated":"2017-10-24 01:50:39.000000000","message":"This comes from the line 65: max_retries\u003d2, right?\ncan you please introduce constants for easy-understand?","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"d14daa15957f5fe7981b1d039ccb9656f08a3b0d","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            # NOTE(mpeterson): RETRIABLE * 3 when expect_retries\u003dTrue since"},{"line_number":133,"context_line":"            # it will retry twice as per the test, plus the original call."},{"line_number":134,"context_line":"            if assert_begin_transaction:"},{"line_number":135,"context_line":"                self.assertEqual(m.call_count, len(RETRIABLE_EXCEPTIONS) * 3)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"            if receives_context:"},{"line_number":138,"context_line":"                with self.db_session.begin():"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f4b6375_60198720","line":135,"range":{"start_line":135,"start_character":75,"end_line":135,"end_character":76},"in_reply_to":"3f4b6375_7bc4a091","updated":"2017-10-25 09:40:32.000000000","message":"Done","commit_id":"fd7db21cac1c60cabf78bf2d02bd908e08401412"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"e27c5321b622f0ec5d27d7a2cb91443f0bfe73d0","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        self.db_session.merge(row1)"},{"line_number":64,"context_line":"        self.db_session.flush()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    # NOTE(mpeterson): make retries faster so it doesn\u0027t take a lot."},{"line_number":67,"context_line":"    @mock.patch.multiple(db_api._retry_db_errors,"},{"line_number":68,"context_line":"                         retry_interval\u003dRETRY_INTERVAL,"},{"line_number":69,"context_line":"                         max_retries\u003dRETRY_MAX)"},{"line_number":70,"context_line":"    def _test_db_exceptions_handled(self, method, mock_object,"},{"line_number":71,"context_line":"                                    receives_context, expect_retries):"},{"line_number":72,"context_line":"        # NOTE(mpeterson): this test is very verbose, disabling logging"},{"line_number":73,"context_line":"        logging.disable(logging.CRITICAL)"},{"line_number":74,"context_line":"        self.addCleanup(logging.disable, logging.NOTSET)"},{"line_number":75,"context_line":"        exceptions \u003d RETRIABLE_EXCEPTIONS"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        r_method \u003d getattr(method, \u0027__wrapped__\u0027, method)"},{"line_number":78,"context_line":"        r_method_args \u003d p_util.getargspec(r_method).args"},{"line_number":79,"context_line":"        args_number \u003d len(r_method_args) - (2 if r_method_args[0] \u003d\u003d \u0027self\u0027"},{"line_number":80,"context_line":"                                            else 1)"},{"line_number":81,"context_line":"        mock_arg \u003d mock.MagicMock(unsafe\u003dTrue)"},{"line_number":82,"context_line":"        # NOTE(mpeterson): workarounds for py3 compatibility and behavior"},{"line_number":83,"context_line":"        # expected by particular functions"},{"line_number":84,"context_line":"        mock_arg.__name__ \u003d \u0027mock_arg\u0027"},{"line_number":85,"context_line":"        mock_arg.retry_count \u003d 1"},{"line_number":86,"context_line":"        mock_arg.__ge__.return_value \u003d True"},{"line_number":87,"context_line":"        mock_arg.__gt__.return_value \u003d True"},{"line_number":88,"context_line":"        mock_arg.__le__.return_value \u003d True"},{"line_number":89,"context_line":"        mock_arg.__lt__.return_value \u003d True"},{"line_number":90,"context_line":"        args \u003d (mock_arg,) * args_number"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        def _assertRaises(exceptions, method, *args, **kwargs):"},{"line_number":93,"context_line":"            try:"},{"line_number":94,"context_line":"                method(*args, **kwargs)"},{"line_number":95,"context_line":"            except Exception as e:"},{"line_number":96,"context_line":"                if not isinstance(e, exceptions):"},{"line_number":97,"context_line":"                    raise e"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"                session \u003d args[0].session if receives_context else args[0]"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"                if session.is_active and isinstance(e, _InnerException):"},{"line_number":102,"context_line":"                    self.assertTrue(getattr(e, \u0027_RETRY_EXCEEDED\u0027, False))"},{"line_number":103,"context_line":"                return"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"            exc_names \u003d (tuple(exc.__name__ for exc in exceptions)"},{"line_number":106,"context_line":"                         if hasattr(exceptions, \u0027__iter__\u0027) else"},{"line_number":107,"context_line":"                         exceptions.__name__)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            self.fail(\u0027%s did not raise %s\u0027 % (method.__name__, exc_names))"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        try:"},{"line_number":112,"context_line":"            raise _InnerException"},{"line_number":113,"context_line":"        except _InnerException as e:"},{"line_number":114,"context_line":"            _e \u003d e"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        expected_retries \u003d RETRY_MAX if expect_retries else 0"},{"line_number":117,"context_line":"        db_object \u003d self.db_context if receives_context else self.db_session"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        for exception in exceptions:"},{"line_number":120,"context_line":"            mock_object.side_effect \u003d exception(_e)"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"            _assertRaises((exception, _InnerException), method,"},{"line_number":123,"context_line":"                          db_object, *args)"},{"line_number":124,"context_line":"            self.assertEqual(expected_retries, mock_object.call_count - 1)"},{"line_number":125,"context_line":"            mock_object.reset_mock()"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _test_retry_exceptions(self, method, mock_object, receives_context,"},{"line_number":128,"context_line":"                               assert_begin_transaction\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f4b6375_d1268c68","line":125,"range":{"start_line":66,"start_character":0,"end_line":125,"end_character":36},"updated":"2017-10-26 05:11:53.000000000","message":"Please break it into smaller methods.","commit_id":"3862450aa9ac3a25396ddac571d7cedcaf31e4c9"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"874c7e52c2209e5ce4e3e4fce95827b49f9db915","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        self.db_session.merge(row1)"},{"line_number":64,"context_line":"        self.db_session.flush()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    # NOTE(mpeterson): make retries faster so it doesn\u0027t take a lot."},{"line_number":67,"context_line":"    @mock.patch.multiple(db_api._retry_db_errors,"},{"line_number":68,"context_line":"                         retry_interval\u003dRETRY_INTERVAL,"},{"line_number":69,"context_line":"                         max_retries\u003dRETRY_MAX)"},{"line_number":70,"context_line":"    def _test_db_exceptions_handled(self, method, mock_object,"},{"line_number":71,"context_line":"                                    receives_context, expect_retries):"},{"line_number":72,"context_line":"        # NOTE(mpeterson): this test is very verbose, disabling logging"},{"line_number":73,"context_line":"        logging.disable(logging.CRITICAL)"},{"line_number":74,"context_line":"        self.addCleanup(logging.disable, logging.NOTSET)"},{"line_number":75,"context_line":"        exceptions \u003d RETRIABLE_EXCEPTIONS"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        r_method \u003d getattr(method, \u0027__wrapped__\u0027, method)"},{"line_number":78,"context_line":"        r_method_args \u003d p_util.getargspec(r_method).args"},{"line_number":79,"context_line":"        args_number \u003d len(r_method_args) - (2 if r_method_args[0] \u003d\u003d \u0027self\u0027"},{"line_number":80,"context_line":"                                            else 1)"},{"line_number":81,"context_line":"        mock_arg \u003d mock.MagicMock(unsafe\u003dTrue)"},{"line_number":82,"context_line":"        # NOTE(mpeterson): workarounds for py3 compatibility and behavior"},{"line_number":83,"context_line":"        # expected by particular functions"},{"line_number":84,"context_line":"        mock_arg.__name__ \u003d \u0027mock_arg\u0027"},{"line_number":85,"context_line":"        mock_arg.retry_count \u003d 1"},{"line_number":86,"context_line":"        mock_arg.__ge__.return_value \u003d True"},{"line_number":87,"context_line":"        mock_arg.__gt__.return_value \u003d True"},{"line_number":88,"context_line":"        mock_arg.__le__.return_value \u003d True"},{"line_number":89,"context_line":"        mock_arg.__lt__.return_value \u003d True"},{"line_number":90,"context_line":"        args \u003d (mock_arg,) * args_number"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        def _assertRaises(exceptions, method, *args, **kwargs):"},{"line_number":93,"context_line":"            try:"},{"line_number":94,"context_line":"                method(*args, **kwargs)"},{"line_number":95,"context_line":"            except Exception as e:"},{"line_number":96,"context_line":"                if not isinstance(e, exceptions):"},{"line_number":97,"context_line":"                    raise e"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"                session \u003d args[0].session if receives_context else args[0]"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"                if session.is_active and isinstance(e, _InnerException):"},{"line_number":102,"context_line":"                    self.assertTrue(getattr(e, \u0027_RETRY_EXCEEDED\u0027, False))"},{"line_number":103,"context_line":"                return"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"            exc_names \u003d (tuple(exc.__name__ for exc in exceptions)"},{"line_number":106,"context_line":"                         if hasattr(exceptions, \u0027__iter__\u0027) else"},{"line_number":107,"context_line":"                         exceptions.__name__)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            self.fail(\u0027%s did not raise %s\u0027 % (method.__name__, exc_names))"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        try:"},{"line_number":112,"context_line":"            raise _InnerException"},{"line_number":113,"context_line":"        except _InnerException as e:"},{"line_number":114,"context_line":"            _e \u003d e"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        expected_retries \u003d RETRY_MAX if expect_retries else 0"},{"line_number":117,"context_line":"        db_object \u003d self.db_context if receives_context else self.db_session"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        for exception in exceptions:"},{"line_number":120,"context_line":"            mock_object.side_effect \u003d exception(_e)"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"            _assertRaises((exception, _InnerException), method,"},{"line_number":123,"context_line":"                          db_object, *args)"},{"line_number":124,"context_line":"            self.assertEqual(expected_retries, mock_object.call_count - 1)"},{"line_number":125,"context_line":"            mock_object.reset_mock()"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _test_retry_exceptions(self, method, mock_object, receives_context,"},{"line_number":128,"context_line":"                               assert_begin_transaction\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f4b6375_bacd1cb8","line":125,"range":{"start_line":66,"start_character":0,"end_line":125,"end_character":36},"in_reply_to":"3f4b6375_d1268c68","updated":"2017-10-26 13:54:18.000000000","message":"this is testing a single behavior actually. Why would you want to break it apart if there is not going to be function reuse? Yes, it\u0027s long because it defines a function inside and sets some things for the test. But the test itself is short L119-125","commit_id":"3862450aa9ac3a25396ddac571d7cedcaf31e4c9"}],"requirements.txt":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0ca87d3754ffd774b61acc0966402ef049b90db8","unresolved":false,"context_lines":[{"line_number":8,"context_line":"debtcollector\u003e\u003d1.2.0 # Apache-2.0"},{"line_number":9,"context_line":"neutron-lib\u003e\u003d1.9.0 # Apache-2.0"},{"line_number":10,"context_line":"websocket-client\u003e\u003d0.33.0 # LGPLv2+"},{"line_number":11,"context_line":"pecan!\u003d1.0.2,!\u003d1.0.3,!\u003d1.0.4,!\u003d1.2,\u003e\u003d1.0.0 # BSD"}],"source_content_type":"text/plain","patch_set":6,"id":"1f2f7f8d_4b3525f7","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":48},"updated":"2017-09-19 00:50:01.000000000","message":"Why do we need this for this patch?","commit_id":"918e82a21236069df87ab1ec9bde4184851852bf"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"61de22f2faf86d00ecd9ecbb8c808275dfc9db5f","unresolved":false,"context_lines":[{"line_number":8,"context_line":"debtcollector\u003e\u003d1.2.0 # Apache-2.0"},{"line_number":9,"context_line":"neutron-lib\u003e\u003d1.9.0 # Apache-2.0"},{"line_number":10,"context_line":"websocket-client\u003e\u003d0.33.0 # LGPLv2+"},{"line_number":11,"context_line":"pecan!\u003d1.0.2,!\u003d1.0.3,!\u003d1.0.4,!\u003d1.2,\u003e\u003d1.0.0 # BSD"}],"source_content_type":"text/plain","patch_set":6,"id":"7f515b1d_903283f1","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":48},"in_reply_to":"1f2f7f8d_4b3525f7","updated":"2017-10-09 17:31:01.000000000","message":"It\u0027s needed to do introspection when one or several decorators might be involved. As you can see neutron\u0027s own retry decorator is using it for the same reason.","commit_id":"918e82a21236069df87ab1ec9bde4184851852bf"}]}
