)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2bb85ec59760490a610f290091e9e021a06c2f6e","unresolved":false,"context_lines":[{"line_number":9,"context_line":"The swiftclient client.py needs to close the http connection after each"},{"line_number":10,"context_line":"succesful/otherwise attempt."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Fixes Bug 1247762"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I1e573c84c581667f8b2f43f05652d6cff0cc6951"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F%2Fc4s%3D","line":12,"updated":"2013-11-05 22:41:51.000000000","message":"This did not get auto picked up. Can you try using small case \"bug\"?","commit_id":"ac43a2fda66c5e1aa11d7fcd3b26c5d1830c489b"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"020a2bdbe92293dca1f9855e256bfc33aedc5e96","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"swift_client needs to close http connection"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The swiftclient client.py needs to close the http connection after each"},{"line_number":10,"context_line":"succesful/otherwise attempt."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Fixes bug 1247762"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAATn%2F%2Bb4c%3D","line":9,"updated":"2013-11-26 04:53:23.000000000","message":"The commit message should explain what exactly is the problem that occurs with the current code (e.g. used in a long-running application stale connections accomulate, or something of that nature that you observed first hand).","commit_id":"e86a35af7418a0a93b793af53398066120eb383c"},{"author":{"_account_id":7701,"name":"Amala Basha","email":"amala.alungal@RACKSPACE.COM","username":"amalabasha"},"change_message_id":"6f6a9cbc021d3c0f24d5873ca6201acc493438a9","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"swift_client needs to close http connection"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The swiftclient client.py needs to close the http connection after each"},{"line_number":10,"context_line":"succesful/otherwise attempt."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Fixes bug 1247762"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAATn%2F%2BVGU%3D","line":9,"in_reply_to":"AAAATn%2F%2Bb4c%3D","updated":"2013-11-27 10:28:32.000000000","message":"Hi Pete,\nThe whole purpose of this patch is to ensure that the http connection is closed once the request is processed unless there be absolute needs for a persistent connection which in this case is mostly not needed. Just as a general good practice.","commit_id":"e86a35af7418a0a93b793af53398066120eb383c"}],"swiftclient/client.py":[{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"63e406784ace6440e79886ecb63da3c33b328ff1","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                                  http_status\u003dresp.status,"},{"line_number":204,"context_line":"                                  http_reason\u003dresp.reason)"},{"line_number":205,"context_line":"    finally:"},{"line_number":206,"context_line":"        conn.close()"},{"line_number":207,"context_line":"    if snet:"},{"line_number":208,"context_line":"        parsed \u003d list(urlparse(url))"},{"line_number":209,"context_line":"        # Second item in the list is the netloc"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FDhY%3D","line":206,"updated":"2013-11-15 03:43:17.000000000","message":"This will blow up if exception happens inside http_connection(). This code need to have try: a line down or forego try/finally and just call conn.close() some time after resp.read().","commit_id":"37ba17fc70830799d58d9a273ef121045a1c6c07"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"020a2bdbe92293dca1f9855e256bfc33aedc5e96","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def get_auth_1_0(url, user, key, snet):"},{"line_number":184,"context_line":"    try:"},{"line_number":185,"context_line":"        parsed, conn \u003d http_connection(url)"},{"line_number":186,"context_line":"        method \u003d \u0027GET\u0027"},{"line_number":187,"context_line":"        conn.request(method, parsed.path, \u0027\u0027,"},{"line_number":188,"context_line":"                     {\u0027X-Auth-User\u0027: user, \u0027X-Auth-Key\u0027: key})"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2Bb5E%3D","line":185,"updated":"2013-11-26 04:53:23.000000000","message":"My comment at the previous patch is not addressed. Almost every block in the patch has the same problem.\n\nWhy can\u0027t you just leave ,conn\u003dhttp_connection() outside the try: block?","commit_id":"e86a35af7418a0a93b793af53398066120eb383c"},{"author":{"_account_id":7701,"name":"Amala Basha","email":"amala.alungal@RACKSPACE.COM","username":"amalabasha"},"change_message_id":"6f6a9cbc021d3c0f24d5873ca6201acc493438a9","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def get_auth_1_0(url, user, key, snet):"},{"line_number":184,"context_line":"    try:"},{"line_number":185,"context_line":"        parsed, conn \u003d http_connection(url)"},{"line_number":186,"context_line":"        method \u003d \u0027GET\u0027"},{"line_number":187,"context_line":"        conn.request(method, parsed.path, \u0027\u0027,"},{"line_number":188,"context_line":"                     {\u0027X-Auth-User\u0027: user, \u0027X-Auth-Key\u0027: key})"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2BVEY%3D","line":185,"in_reply_to":"AAAATn%2F%2Bb5E%3D","updated":"2013-11-27 10:28:32.000000000","message":"Ah! got it now! makes sense.","commit_id":"e86a35af7418a0a93b793af53398066120eb383c"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"020a2bdbe92293dca1f9855e256bfc33aedc5e96","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    finally:"},{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            conn.close()"},{"line_number":208,"context_line":"        except Exception:"},{"line_number":209,"context_line":"            raise"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    if snet:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2Bb5c%3D","line":208,"updated":"2013-11-26 04:53:23.000000000","message":"What in the world is this supposed to do? This code just re-raises the exception without taking any action. It makes no sense to me.\n\nIn any case, it\u0027s a wrong place to fix up things in case http_connection() raised an exception.","commit_id":"e86a35af7418a0a93b793af53398066120eb383c"},{"author":{"_account_id":7701,"name":"Amala Basha","email":"amala.alungal@RACKSPACE.COM","username":"amalabasha"},"change_message_id":"6f6a9cbc021d3c0f24d5873ca6201acc493438a9","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    finally:"},{"line_number":206,"context_line":"        try:"},{"line_number":207,"context_line":"            conn.close()"},{"line_number":208,"context_line":"        except Exception:"},{"line_number":209,"context_line":"            raise"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    if snet:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2BVEk%3D","line":208,"in_reply_to":"AAAATn%2F%2Bb5c%3D","updated":"2013-11-27 10:28:32.000000000","message":"TBH I hadnt really understood your previous comment, my understanding was that in case the conn.close() itself raises any exception this would break. Hence this approach which honestly sounded weird to me too.","commit_id":"e86a35af7418a0a93b793af53398066120eb383c"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"71f604cfbc89fd3f7a9e40a18a20f81781828b7e","unresolved":false,"context_lines":[{"line_number":417,"context_line":"                                  http_response_content\u003dbody)"},{"line_number":418,"context_line":"    finally:"},{"line_number":419,"context_line":"        #NOTE(basha): the connection might have to be reused if connection"},{"line_number":420,"context_line":"        #is not None"},{"line_number":421,"context_line":"        if connection is None:"},{"line_number":422,"context_line":"            conn.close()"},{"line_number":423,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F9iEo%3D","line":420,"updated":"2014-02-06 08:54:21.000000000","message":"I\u0027m with Pete and Chmouel, maybe you can remove the NOTE (applies to all finally-clauses).","commit_id":"349f6b51db893f2eaf64597112d47dde8c2b93a1"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"71f604cfbc89fd3f7a9e40a18a20f81781828b7e","unresolved":false,"context_lines":[{"line_number":1010,"context_line":"        if content_type is not None:"},{"line_number":1011,"context_line":"            headers[\u0027Content-Type\u0027] \u003d content_type"},{"line_number":1012,"context_line":"        if not contents:"},{"line_number":1013,"context_line":"            headers[\u0027Content-Length\u0027] \u003d \u00270\u0027"},{"line_number":1014,"context_line":"        if hasattr(contents, \u0027read\u0027):"},{"line_number":1015,"context_line":"            if chunk_size is None:"},{"line_number":1016,"context_line":"                chunk_size \u003d 65536"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F9iG8%3D","line":1013,"updated":"2014-02-06 08:54:21.000000000","message":"Why not limit the try clause to code that is actually using conn? The first use of conn happens inside this if-condition, so the try could be placed between line 1013/1014.","commit_id":"349f6b51db893f2eaf64597112d47dde8c2b93a1"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"d06c899dcb7309d564d79803d5094ff3d6043f6e","unresolved":false,"context_lines":[{"line_number":1010,"context_line":"        if content_type is not None:"},{"line_number":1011,"context_line":"            headers[\u0027Content-Type\u0027] \u003d content_type"},{"line_number":1012,"context_line":"        if not contents:"},{"line_number":1013,"context_line":"            headers[\u0027Content-Length\u0027] \u003d \u00270\u0027"},{"line_number":1014,"context_line":"        if hasattr(contents, \u0027read\u0027):"},{"line_number":1015,"context_line":"            if chunk_size is None:"},{"line_number":1016,"context_line":"                chunk_size \u003d 65536"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F9dYs%3D","line":1013,"in_reply_to":"AAAAUH%2F9iG8%3D","updated":"2014-02-06 19:19:39.000000000","message":"I can see why Basha did it this way. If you try to catch the first use, you\u0027re opening yourself to bugs due to code re-arrangement. And this keeps the function reasonably indented, too, except shifted right wholesale. A better move would be probably break the scope into another function, but I dunno, it\u0027s a matter of taste.","commit_id":"349f6b51db893f2eaf64597112d47dde8c2b93a1"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"d06c899dcb7309d564d79803d5094ff3d6043f6e","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                                  http_reason\u003dresp.reason,"},{"line_number":1178,"context_line":"                                  http_response_content\u003dbody)"},{"line_number":1179,"context_line":"    finally:"},{"line_number":1180,"context_line":"        #NOTE(basha): the connection might have to be reused if connection"},{"line_number":1181,"context_line":"        #is not None"},{"line_number":1182,"context_line":"        if connection is None:"},{"line_number":1183,"context_line":"            conn.close()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F9dYY%3D","line":1180,"updated":"2014-02-06 19:19:39.000000000","message":"Seriously, these #NOTE are terrible.","commit_id":"349f6b51db893f2eaf64597112d47dde8c2b93a1"}]}
