)]}'
{"keystone/token/persistence/backends/sql.py":[{"author":{"_account_id":11816,"name":"mike_mp@zzzcomputing.com","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"79f4c999474388d15039ddbffd6ea2fae814b470","unresolved":false,"context_lines":[{"line_number":285,"context_line":"                delete_query \u003d query.filter(TokenModel.expires \u003c\u003d"},{"line_number":286,"context_line":"                                            expiry_time)"},{"line_number":287,"context_line":"                row_count \u003d delete_query.delete(synchronize_session\u003dFalse)"},{"line_number":288,"context_line":"                session.begin(subtransactions\u003dTrue)"},{"line_number":289,"context_line":"                # Explicitly commit each batch so as to free up"},{"line_number":290,"context_line":"                # resources early. We do not actually need"},{"line_number":291,"context_line":"                # transactional semantics here."}],"source_content_type":"text/x-python","patch_set":1,"id":"3f1d235d_14fbfe46","line":288,"updated":"2017-07-05 18:55:32.000000000","message":"mmm I don\u0027t think this will work, as a \"subtransaction\" is just a lexical scope, doesn\u0027t actually do anything.  it makes the commit() below have no effect database wise, because it\u0027s waiting for one level of nesting introduced by the \"subtransaction\" to close out first.\n\nHere\u0027s the flow:\n\n  with sql.session_for_write() as session:  # \u003c--- calls session.begin()\n\n      for criteria in stuff:\n           session.query(TokenModel).filter(criteria).delete()\n       \n      session.commit()  # \u003c---- emits connection.commit() on DBAPI connection\n\n      # now we want to continue the loop with a transaction still going on.  so begin again:\n      session.begin()  # tells SQLAlchemy to \"begin\"\n\n\n  # end of \"with\" block, calls session.commit()\n\nKeep in mind that underneath all of SQLAlchemy, the DBAPI itself is in a \"never autocommit\" mode; that is, BEGIN is emitted automatically as soon as any work is done; COMMIT is emitted when one calls connection.commit().  So SQLAlchemy is only simulating \"begin\" here in any case, it is in fact automatic by the DBAPI.","commit_id":"5294951c0e1a8bb9d5253845ea1c06900c145893"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"e86e5cab4c3dc293ee5c252a5cb23b903cee6bff","unresolved":false,"context_lines":[{"line_number":289,"context_line":"                # resources early. We do not actually need"},{"line_number":290,"context_line":"                # transactional semantics here."},{"line_number":291,"context_line":"                session.commit()"},{"line_number":292,"context_line":"                session.begin()"},{"line_number":293,"context_line":"                total_removed +\u003d row_count"},{"line_number":294,"context_line":"                LOG.debug(\u0027Removed %d total expired tokens\u0027, total_removed)"},{"line_number":295,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_fa198879","line":292,"updated":"2017-07-05 21:11:07.000000000","message":"Mike provided a bunch of good information in the previous review as to why we need this. Can any of that be rolled into a comment?","commit_id":"24818791d515fa08977ed6aa30d3105605e6f37e"},{"author":{"_account_id":8866,"name":"Raildo Mascena de Sousa Filho","email":"rmascena@redhat.com","username":"raildo"},"change_message_id":"41c50715206e05d4ae6041c52ded9bd192c398d7","unresolved":false,"context_lines":[{"line_number":289,"context_line":"                # resources early. We do not actually need"},{"line_number":290,"context_line":"                # transactional semantics here."},{"line_number":291,"context_line":"                session.commit()"},{"line_number":292,"context_line":"                session.begin()"},{"line_number":293,"context_line":"                total_removed +\u003d row_count"},{"line_number":294,"context_line":"                LOG.debug(\u0027Removed %d total expired tokens\u0027, total_removed)"},{"line_number":295,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_10e54309","line":292,"in_reply_to":"3f1d235d_fa198879","updated":"2017-07-05 22:45:54.000000000","message":"Sure, this makes much sense, I\u0027ll add a comment explaining the change.","commit_id":"24818791d515fa08977ed6aa30d3105605e6f37e"},{"author":{"_account_id":11816,"name":"mike_mp@zzzcomputing.com","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"362315e8b741c73aef27a23e8d6e3415668bf929","unresolved":false,"context_lines":[{"line_number":277,"context_line":"    def flush_expired_tokens(self):"},{"line_number":278,"context_line":"        # The DBAPI itself is in a \"never autocommit\" mode,"},{"line_number":279,"context_line":"        # BEGIN is emitted automatically as soon as any work is done,"},{"line_number":280,"context_line":"        # COMMIT is emitted when one calls connection.commit()."},{"line_number":281,"context_line":"        # So SQLAlchemy is only simulating \"begin\" here in any case,"},{"line_number":282,"context_line":"        # it is in fact automatic by the DBAPI."},{"line_number":283,"context_line":"        with sql.session_for_write() as session:  # Calls session.begin()"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f1d235d_b9b3fee8","line":280,"updated":"2017-07-06 15:10:13.000000000","message":"\"COMMIT is emitted when SQLAlchemy invokes commit() on the underlying DBAPI connection\"","commit_id":"e3e183fc41249c2b7b95908945da966d64ff1dea"},{"author":{"_account_id":8866,"name":"Raildo Mascena de Sousa Filho","email":"rmascena@redhat.com","username":"raildo"},"change_message_id":"250d4525f8cc812c404dd0d795029d1c3169066f","unresolved":false,"context_lines":[{"line_number":277,"context_line":"    def flush_expired_tokens(self):"},{"line_number":278,"context_line":"        # The DBAPI itself is in a \"never autocommit\" mode,"},{"line_number":279,"context_line":"        # BEGIN is emitted automatically as soon as any work is done,"},{"line_number":280,"context_line":"        # COMMIT is emitted when one calls connection.commit()."},{"line_number":281,"context_line":"        # So SQLAlchemy is only simulating \"begin\" here in any case,"},{"line_number":282,"context_line":"        # it is in fact automatic by the DBAPI."},{"line_number":283,"context_line":"        with sql.session_for_write() as session:  # Calls session.begin()"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f1d235d_741fab07","line":280,"in_reply_to":"3f1d235d_b9b3fee8","updated":"2017-07-06 15:26:18.000000000","message":"Done","commit_id":"e3e183fc41249c2b7b95908945da966d64ff1dea"},{"author":{"_account_id":11816,"name":"mike_mp@zzzcomputing.com","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"362315e8b741c73aef27a23e8d6e3415668bf929","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                # resources early. We do not actually need"},{"line_number":295,"context_line":"                # transactional semantics here."},{"line_number":296,"context_line":"                session.commit()  # Emits connection.commit() on DBAPI"},{"line_number":297,"context_line":"                session.begin()  # Tells SQLAlchemy to begin"},{"line_number":298,"context_line":"                total_removed +\u003d row_count"},{"line_number":299,"context_line":"                LOG.debug(\u0027Removed %d total expired tokens\u0027, total_removed)"},{"line_number":300,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f1d235d_99a5e2a4","line":297,"updated":"2017-07-06 15:10:13.000000000","message":"if we want the comments here then I\u0027d make this one like:\n\n # Tells SQLAlchemy to \"begin\", e.g. hold a new connection open in a transaction","commit_id":"e3e183fc41249c2b7b95908945da966d64ff1dea"},{"author":{"_account_id":8866,"name":"Raildo Mascena de Sousa Filho","email":"rmascena@redhat.com","username":"raildo"},"change_message_id":"250d4525f8cc812c404dd0d795029d1c3169066f","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                # resources early. We do not actually need"},{"line_number":295,"context_line":"                # transactional semantics here."},{"line_number":296,"context_line":"                session.commit()  # Emits connection.commit() on DBAPI"},{"line_number":297,"context_line":"                session.begin()  # Tells SQLAlchemy to begin"},{"line_number":298,"context_line":"                total_removed +\u003d row_count"},{"line_number":299,"context_line":"                LOG.debug(\u0027Removed %d total expired tokens\u0027, total_removed)"},{"line_number":300,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f1d235d_9424875f","line":297,"in_reply_to":"3f1d235d_99a5e2a4","updated":"2017-07-06 15:26:18.000000000","message":"Done","commit_id":"e3e183fc41249c2b7b95908945da966d64ff1dea"},{"author":{"_account_id":11816,"name":"mike_mp@zzzcomputing.com","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"362315e8b741c73aef27a23e8d6e3415668bf929","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                session.begin()  # Tells SQLAlchemy to begin"},{"line_number":298,"context_line":"                total_removed +\u003d row_count"},{"line_number":299,"context_line":"                LOG.debug(\u0027Removed %d total expired tokens\u0027, total_removed)"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"            session.flush()"},{"line_number":302,"context_line":"            LOG.info(\u0027Total expired tokens removed: %d\u0027, total_removed)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f1d235d_79c9e656","line":300,"updated":"2017-07-06 15:10:13.000000000","message":"..\n\n   # when the \"with: \" block ends, the final \"session.commit()\" is emitted by enginefacade","commit_id":"e3e183fc41249c2b7b95908945da966d64ff1dea"},{"author":{"_account_id":8866,"name":"Raildo Mascena de Sousa Filho","email":"rmascena@redhat.com","username":"raildo"},"change_message_id":"250d4525f8cc812c404dd0d795029d1c3169066f","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                session.begin()  # Tells SQLAlchemy to begin"},{"line_number":298,"context_line":"                total_removed +\u003d row_count"},{"line_number":299,"context_line":"                LOG.debug(\u0027Removed %d total expired tokens\u0027, total_removed)"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"            session.flush()"},{"line_number":302,"context_line":"            LOG.info(\u0027Total expired tokens removed: %d\u0027, total_removed)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f1d235d_b429c337","line":300,"in_reply_to":"3f1d235d_79c9e656","updated":"2017-07-06 15:26:18.000000000","message":"Done","commit_id":"e3e183fc41249c2b7b95908945da966d64ff1dea"}],"releasenotes/notes/bug-1649616-b835d1dac3401e8c.yaml":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"44bb83dcaa39c459830b82ba4e47e4562fd0d736","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    During a backport patch for this fix it was found some problems in"},{"line_number":7,"context_line":"    the previous approach like, It didn\u0027t enabled back the session.autocommit."},{"line_number":8,"context_line":"    In addition, we have a better approach for this holding a new connection"},{"line_number":9,"context_line":"    open in the commit transaction instead of disable/enable autocommit."}],"source_content_type":"text/x-yaml","patch_set":5,"id":"3f1d235d_9cd44d49","line":9,"updated":"2017-07-10 20:06:32.000000000","message":"This level of detail probably isn\u0027t required. We could just say that significant improvements have been made when performing a token flush on massive data sets.\n\nIf folks want more information they can checkout the bug report.","commit_id":"c4ca474ae9f24d4ce2924f79bf1b3a4fb10cc52d"},{"author":{"_account_id":8866,"name":"Raildo Mascena de Sousa Filho","email":"rmascena@redhat.com","username":"raildo"},"change_message_id":"589a3f63c01d8db1e07589b4b2d35782cb15dad3","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    During a backport patch for this fix it was found some problems in"},{"line_number":7,"context_line":"    the previous approach like, It didn\u0027t enabled back the session.autocommit."},{"line_number":8,"context_line":"    In addition, we have a better approach for this holding a new connection"},{"line_number":9,"context_line":"    open in the commit transaction instead of disable/enable autocommit."}],"source_content_type":"text/x-yaml","patch_set":5,"id":"3f1d235d_9c07adca","line":9,"in_reply_to":"3f1d235d_9cd44d49","updated":"2017-07-10 20:10:59.000000000","message":"Done","commit_id":"c4ca474ae9f24d4ce2924f79bf1b3a4fb10cc52d"}]}
