)]}'
{"swift/common/db.py":[{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"bd13f979f00a817a0e514bf4ed82c588a6cee750","unresolved":false,"context_lines":[{"line_number":257,"context_line":"                if os.path.exists(self.db_file):"},{"line_number":258,"context_line":"                    # It\u0027s as if there was a \"condition\" where different parts"},{"line_number":259,"context_line":"                    # of the system were \"racing\" each other."},{"line_number":260,"context_line":"                    raise DatabaseAlreadyExists(self.db_file)"},{"line_number":261,"context_line":"                renamer(tmp_db_file, self.db_file)"},{"line_number":262,"context_line":"            self.conn \u003d get_db_connection(self.db_file, self.timeout)"},{"line_number":263,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2F%2FBg%3D","line":260,"updated":"2013-05-17 04:48:01.000000000","message":"If callers of this will be trapping DatabaseAlreadyExists and continuing to use this broker object, maybe we should set self.conn to the result of get_db_connection(...) here before raising the exception?","commit_id":"54d2b5d273065c91b0d977de9014fcb2d89fabe6"},{"author":{"_account_id":4108,"name":"David Hadas","email":"davidh@il.ibm.com","username":"david-hadas"},"change_message_id":"79c64bfcad4b537ccca4afd72196fde14588034f","unresolved":false,"context_lines":[{"line_number":257,"context_line":"                if os.path.exists(self.db_file):"},{"line_number":258,"context_line":"                    # It\u0027s as if there was a \"condition\" where different parts"},{"line_number":259,"context_line":"                    # of the system were \"racing\" each other."},{"line_number":260,"context_line":"                    raise DatabaseAlreadyExists(self.db_file)"},{"line_number":261,"context_line":"                renamer(tmp_db_file, self.db_file)"},{"line_number":262,"context_line":"            self.conn \u003d get_db_connection(self.db_file, self.timeout)"},{"line_number":263,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Ftcs%3D","line":260,"in_reply_to":"AAAAPH%2F%2F%2FBg%3D","updated":"2013-05-24 19:25:11.000000000","message":"The way the db.py is written, it seems that self.conn is a cache and may or may not be initialized - i.e. it is tested before used. It therefore makes less sense to open the sql connection at this point since we may not ever use it.","commit_id":"54d2b5d273065c91b0d977de9014fcb2d89fabe6"},{"author":{"_account_id":4108,"name":"David Hadas","email":"davidh@il.ibm.com","username":"david-hadas"},"change_message_id":"79c64bfcad4b537ccca4afd72196fde14588034f","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                    # It\u0027s as if there was a \"condition\" where different parts"},{"line_number":259,"context_line":"                    # of the system were \"racing\" each other."},{"line_number":260,"context_line":"                    raise DatabaseAlreadyExists(self.db_file)"},{"line_number":261,"context_line":"                renamer(tmp_db_file, self.db_file)"},{"line_number":262,"context_line":"            self.conn \u003d get_db_connection(self.db_file, self.timeout)"},{"line_number":263,"context_line":"        else:"},{"line_number":264,"context_line":"            self.conn \u003d conn"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FtcI%3D","line":261,"updated":"2013-05-24 19:25:11.000000000","message":"I am a bit troubled by this also - but for the opposite reason - I think we need to remove this next line as it is non optimized.\n\nThis code comes from the original 2010 \"Initial commit of Swift code\"  - so I am inclined to leave it for Historic Preservation :)","commit_id":"54d2b5d273065c91b0d977de9014fcb2d89fabe6"}],"swift/container/server.py":[{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"bd13f979f00a817a0e514bf4ed82c588a6cee750","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                broker.initialize(normalize_timestamp("},{"line_number":203,"context_line":"                    req.headers.get(\u0027x-timestamp\u0027) or time.time()))"},{"line_number":204,"context_line":"            except swift.common.db.DatabaseAlreadyExists:"},{"line_number":205,"context_line":"                pass"},{"line_number":206,"context_line":"        if not os.path.exists(broker.db_file):"},{"line_number":207,"context_line":"            return HTTPNotFound()"},{"line_number":208,"context_line":"        if obj:     # delete object"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2F%2FB0%3D","line":205,"updated":"2013-05-17 04:48:01.000000000","message":"If the race was lost, that exception caught, and this pass executed... won\u0027t the broker be uninitialized, potentially causing trouble when it gets used later?","commit_id":"54d2b5d273065c91b0d977de9014fcb2d89fabe6"},{"author":{"_account_id":4108,"name":"David Hadas","email":"davidh@il.ibm.com","username":"david-hadas"},"change_message_id":"79c64bfcad4b537ccca4afd72196fde14588034f","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                broker.initialize(normalize_timestamp("},{"line_number":203,"context_line":"                    req.headers.get(\u0027x-timestamp\u0027) or time.time()))"},{"line_number":204,"context_line":"            except swift.common.db.DatabaseAlreadyExists:"},{"line_number":205,"context_line":"                pass"},{"line_number":206,"context_line":"        if not os.path.exists(broker.db_file):"},{"line_number":207,"context_line":"            return HTTPNotFound()"},{"line_number":208,"context_line":"        if obj:     # delete object"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FtcQ%3D","line":205,"in_reply_to":"AAAAPH%2F%2F%2FB0%3D","updated":"2013-05-24 19:25:11.000000000","message":"In this case the broker will be as uninitialized as if the broker.initialize was never called... - i.e. if os.path.exists(broker.db_file) was true to start with... So there is no problem here.","commit_id":"54d2b5d273065c91b0d977de9014fcb2d89fabe6"}],"test/unit/common/test_db.py":[{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"904d3ceb6588824f487d2d3c17d6ad5b26fc823d","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            broker._initialize \u003d stub"},{"line_number":159,"context_line":"            self.assertRaises(swift.common.db.DatabaseAlreadyExists,"},{"line_number":160,"context_line":"                broker.initialize, normalize_timestamp(\u00271\u0027))"},{"line_number":161,"context_line":"        except:"},{"line_number":162,"context_line":"            os.path.exists \u003d _exists"},{"line_number":163,"context_line":"        "},{"line_number":164,"context_line":"    def test_delete_db(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FdP4%3D","line":161,"updated":"2013-05-09 00:31:11.000000000","message":"This would be better written like so:\n\n    with mock.patch(\u0027os.path.exists\u0027, new\u003dmy_exists):\n        broker \u003d DatabaseBroker...\n\nThere are plenty of places in the tests where we\u0027re not using mock since it was added relatively recently, but I prefer it over hand-patching since it\u0027s less error-prone. (For example, this test should use \"finally\" instead of \"except\" in order to clean up properly.)","commit_id":"05ab233521e2d4d1d928e915f13538e6b532ecd9"},{"author":{"_account_id":4108,"name":"David Hadas","email":"davidh@il.ibm.com","username":"david-hadas"},"change_message_id":"715c71aa3d544961b6acab9ecd7921bfe85ab8a8","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            broker._initialize \u003d stub"},{"line_number":159,"context_line":"            self.assertRaises(swift.common.db.DatabaseAlreadyExists,"},{"line_number":160,"context_line":"                broker.initialize, normalize_timestamp(\u00271\u0027))"},{"line_number":161,"context_line":"        except:"},{"line_number":162,"context_line":"            os.path.exists \u003d _exists"},{"line_number":163,"context_line":"        "},{"line_number":164,"context_line":"    def test_delete_db(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FYSk%3D","line":161,"in_reply_to":"AAAAOn%2F%2FdP4%3D","updated":"2013-05-12 19:49:36.000000000","message":"Sam, Thanks for this catch.\n\nI\u0027ll play around with mock - never tried this before.","commit_id":"05ab233521e2d4d1d928e915f13538e6b532ecd9"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"904d3ceb6588824f487d2d3c17d6ad5b26fc823d","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                broker.initialize, normalize_timestamp(\u00271\u0027))"},{"line_number":161,"context_line":"        except:"},{"line_number":162,"context_line":"            os.path.exists \u003d _exists"},{"line_number":163,"context_line":"        "},{"line_number":164,"context_line":"    def test_delete_db(self):"},{"line_number":165,"context_line":"        def init_stub(conn, put_timestamp):"},{"line_number":166,"context_line":"            conn.execute(\u0027CREATE TABLE test (one TEXT)\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FdPs%3D","line":163,"updated":"2013-05-09 00:31:11.000000000","message":"Got some trailing whitespace here. This may make flake8 unhappy; I don\u0027t know.","commit_id":"05ab233521e2d4d1d928e915f13538e6b532ecd9"}]}
