)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"2bdf354233d5452447975c461d10137afc7d7d6c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"handle_connect_error() open and return a test connection, but nobody"},{"line_number":10,"context_line":"uses it in create_engine(), so (depending on Python interpreter) this"},{"line_number":11,"context_line":"connection can stay opened in the pool for a some time."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Roman Podoliaka \u003crpodolyaka@mirantis.com\u003e"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"fa81d914_a9d05d54","line":11,"updated":"2015-01-28 10:42:50.000000000","message":"nit: s/a//","commit_id":"08ebf5e78d40a6b0fadb08cdc5d3fcc5deeb45f8"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"c0f4a7a58e6796713f6c2ad3c5ea4d9a4adb8a4c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"handle_connect_error() open and return a test connection, but nobody"},{"line_number":10,"context_line":"uses it in create_engine(), so (depending on Python interpreter) this"},{"line_number":11,"context_line":"connection can stay opened in the pool for a some time."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Roman Podoliaka \u003crpodolyaka@mirantis.com\u003e"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"fa81d914_4c09af30","line":11,"in_reply_to":"fa81d914_a9d05d54","updated":"2015-01-28 11:36:08.000000000","message":"Done","commit_id":"08ebf5e78d40a6b0fadb08cdc5d3fcc5deeb45f8"}],"oslo/db/sqlalchemy/session.py":[{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"5a68c727485290540478a0b692276314e9fab482","unresolved":false,"context_lines":[{"line_number":410,"context_line":"    # initial connect + test"},{"line_number":411,"context_line":"    # NOTE(viktors): the current realization of _test_connection(), it"},{"line_number":412,"context_line":"    # does nothing, if max_retries \u003d\u003d 0, so we can skip it"},{"line_number":413,"context_line":"    if max_retries !\u003d 0:"},{"line_number":414,"context_line":"        test_conn \u003d _test_connection(engine, max_retries, retry_interval)"},{"line_number":415,"context_line":"        test_conn.close()"},{"line_number":416,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_c57ac224","line":413,"updated":"2014-11-28 22:16:30.000000000","message":"Why not just:\n\n    if max_retries:","commit_id":"c492b9cf2c8c55317661f91f7f85a18299ad5540"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"e42aea24540adc2a5d72b4a0657b63a3e7d6240f","unresolved":false,"context_lines":[{"line_number":410,"context_line":"    # initial connect + test"},{"line_number":411,"context_line":"    # NOTE(viktors): the current realization of _test_connection(), it"},{"line_number":412,"context_line":"    # does nothing, if max_retries \u003d\u003d 0, so we can skip it"},{"line_number":413,"context_line":"    if max_retries !\u003d 0:"},{"line_number":414,"context_line":"        test_conn \u003d _test_connection(engine, max_retries, retry_interval)"},{"line_number":415,"context_line":"        test_conn.close()"},{"line_number":416,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_24095231","line":413,"in_reply_to":"5a890539_c57ac224","updated":"2014-12-03 16:15:26.000000000","message":"Done","commit_id":"c492b9cf2c8c55317661f91f7f85a18299ad5540"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"b2425abf011739f51db59a8405808462f64c01a5","unresolved":false,"context_lines":[{"line_number":411,"context_line":"    # NOTE(viktors): the current realization of _test_connection()"},{"line_number":412,"context_line":"    #                does nothing, if max_retries \u003d\u003d 0, so we can skip it"},{"line_number":413,"context_line":"    if max_retries:"},{"line_number":414,"context_line":"        test_conn \u003d _test_connection(engine, max_retries, retry_interval)"},{"line_number":415,"context_line":"        test_conn.close()"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"    return engine"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_5e6e1c01","line":414,"updated":"2014-12-03 21:38:35.000000000","message":"can we encapsulate this inside of _test_connection()?  _test_connection() shouldn\u0027t have to return anything.  Additionally the way exc_filters.handle_connect_error is called is confusing, because it is actually doing the connect...I\u0027d favor turning handle_connnect_error into a @contextmanager that only receives the exception:\n\n    @contextlib.contextmanager\n    def handle_connect_error(engine):\n        try:\n            yield engine\n        except Exception as e:\n            # ...\n            # ctx \u003d \n            # handler(ctx)\n\n    # ... \n\n    def _test_connection(engine, max_retries, retry_interval):\n        if not max_retries:\n            return\n        elif max_retries \u003d\u003d -1:\n            attempts \u003d itertools.count()\n        else:\n            attempts \u003d six.moves.range(max_retries)\n        de_ref \u003d None\n        for attempt in attempts:\n            try:\n                with exc_filters.handle_connect_error(engine):\n                    conn \u003d engine.connect()\n            except exception.DBConnectionError as de:\n                msg \u003d _LW(\u0027SQL connection failed. %s attempts left.\u0027)\n                LOG.warning(msg, max_retries - attempt)\n                time.sleep(retry_interval)\n                de_ref \u003d de\n            else:\n                conn.close()\n        else:\n            if de_ref is not None:\n                six.reraise(type(de_ref), de_ref)","commit_id":"71de210e63defc27d2ce2566860388d7cd03fd1c"}],"oslo_db/sqlalchemy/session.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"2bdf354233d5452447975c461d10137afc7d7d6c","unresolved":false,"context_lines":[{"line_number":408,"context_line":"    compat.engine_connect(engine, _connect_ping_listener)"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    # initial connect + test"},{"line_number":411,"context_line":"    # NOTE(viktors): the current realization of _test_connection()"},{"line_number":412,"context_line":"    #                does nothing, if max_retries \u003d\u003d 0, so we can skip it"},{"line_number":413,"context_line":"    if max_retries:"},{"line_number":414,"context_line":"        test_conn \u003d _test_connection(engine, max_retries, retry_interval)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa81d914_29dd4d71","line":411,"updated":"2015-01-28 10:42:50.000000000","message":"nit: implementation :)","commit_id":"08ebf5e78d40a6b0fadb08cdc5d3fcc5deeb45f8"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"c0f4a7a58e6796713f6c2ad3c5ea4d9a4adb8a4c","unresolved":false,"context_lines":[{"line_number":408,"context_line":"    compat.engine_connect(engine, _connect_ping_listener)"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    # initial connect + test"},{"line_number":411,"context_line":"    # NOTE(viktors): the current realization of _test_connection()"},{"line_number":412,"context_line":"    #                does nothing, if max_retries \u003d\u003d 0, so we can skip it"},{"line_number":413,"context_line":"    if max_retries:"},{"line_number":414,"context_line":"        test_conn \u003d _test_connection(engine, max_retries, retry_interval)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa81d914_afff7d00","line":411,"in_reply_to":"fa81d914_29dd4d71","updated":"2015-01-28 11:36:08.000000000","message":"ouch :)","commit_id":"08ebf5e78d40a6b0fadb08cdc5d3fcc5deeb45f8"}]}
