)]}'
{"swift/obj/diskfile.py":[{"author":{"_account_id":16896,"name":"Ondřej Nový","email":"novy@ondrej.org","username":"onovy"},"change_message_id":"e480d228ee1abb1829c80d6d5b454058d4e99b3f","unresolved":false,"context_lines":[{"line_number":1809,"context_line":"            if io_err.errno in (errno.ENOSPC, errno.EDQUOT):"},{"line_number":1810,"context_line":"                msg \u003d (_(\"No space left on device for %s\"),"},{"line_number":1811,"context_line":"                       durable_file_path)"},{"line_number":1812,"context_line":"                exc \u003d DiskFileNoSpace()"},{"line_number":1813,"context_line":"            else:"},{"line_number":1814,"context_line":"                msg \u003d (_(\u0027Problem writing durable state file: %s\u0027),"},{"line_number":1815,"context_line":"                       durable_file_path)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_4da0f090","side":"PARENT","line":1812,"updated":"2015-07-24 20:49:23.000000000","message":"why not just change this line to:\nexc \u003d DiskFileNoSpace(msg)","commit_id":"74455ad74c6b021a19de291aa2c5130d691d1e40"},{"author":{"_account_id":17276,"name":"Carlos Cavanna","email":"ccavanna@ca.ibm.com","username":"ccavanna"},"change_message_id":"2b53bffdd9ef0e63556a68a4bf1a0bfa6ef28603","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"3a50d1a3_9c1a8817","updated":"2015-07-31 15:58:25.000000000","message":"re-raising the exception makes the code harder to follow.\nIt may be better to just add an additional catch block\n\nexcept Exception as err\n      msg \u003d (_(\u0027Problem writing durable state file %s (%s)\u0027) %\n\nso we can catch any unexpected errors (something that was missing). This will be a minor code duplication, but more readable code.\n\nAnother chang is that in the older verision of the code, when we check for:\n     if io_err.errno in (errno.ENOSPC, errno.EDQUOT):\n\nwe should probably log the errno in the else case to give some information about the unexpected error.","commit_id":"94be0a78f3726dfc8787c44ddc617fb4d5e7b731"},{"author":{"_account_id":16896,"name":"Ondřej Nový","email":"novy@ondrej.org","username":"onovy"},"change_message_id":"e480d228ee1abb1829c80d6d5b454058d4e99b3f","unresolved":false,"context_lines":[{"line_number":1793,"context_line":""},{"line_number":1794,"context_line":"    def _finalize_durable(self, durable_file_path):"},{"line_number":1795,"context_line":"        exc \u003d None"},{"line_number":1796,"context_line":"        try:"},{"line_number":1797,"context_line":"            try:"},{"line_number":1798,"context_line":"                with open(durable_file_path, \u0027w\u0027) as _fp:"},{"line_number":1799,"context_line":"                    fsync(_fp.fileno())"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_4d79d02e","line":1796,"updated":"2015-07-24 20:49:23.000000000","message":"fthis try/catch in try/catch is less readable then older version for me.\n\nWhy this change?","commit_id":"94be0a78f3726dfc8787c44ddc617fb4d5e7b731"},{"author":{"_account_id":16896,"name":"Ondřej Nový","email":"novy@ondrej.org","username":"onovy"},"change_message_id":"e480d228ee1abb1829c80d6d5b454058d4e99b3f","unresolved":false,"context_lines":[{"line_number":1797,"context_line":"            try:"},{"line_number":1798,"context_line":"                with open(durable_file_path, \u0027w\u0027) as _fp:"},{"line_number":1799,"context_line":"                    fsync(_fp.fileno())"},{"line_number":1800,"context_line":"                fsync_dir(self._datadir)"},{"line_number":1801,"context_line":"            except (OSError, IOError) as err:"},{"line_number":1802,"context_line":"                if err.errno not in (errno.ENOSPC, errno.EDQUOT):"},{"line_number":1803,"context_line":"                    # re-raise to catch all handler"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_0d9c2868","line":1800,"updated":"2015-07-24 20:49:23.000000000","message":"why are you adding fsync_dir here?","commit_id":"94be0a78f3726dfc8787c44ddc617fb4d5e7b731"},{"author":{"_account_id":17276,"name":"Carlos Cavanna","email":"ccavanna@ca.ibm.com","username":"ccavanna"},"change_message_id":"0cbfed29bc7cbd4d0d2e9368a0c2ad6fb2aa9b07","unresolved":false,"context_lines":[{"line_number":1791,"context_line":""},{"line_number":1792,"context_line":"class ECDiskFileWriter(DiskFileWriter):"},{"line_number":1793,"context_line":""},{"line_number":1794,"context_line":"    def _finalize_durable(self, durable_file_path):"},{"line_number":1795,"context_line":"        exc \u003d None"},{"line_number":1796,"context_line":"        try:"},{"line_number":1797,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_895c7a7e","line":1794,"updated":"2015-07-31 22:40:52.000000000","message":"There aren\u0027t many differences between Patch 3 and Patch 2. :-)\n\nI was thinking that you could refactor the code like this (pseudo code below). It\u0027s easier to read (more linear) and still throws the exception if self.manager.logger fails (were you trying to avoid this particular problem?)\n\nAlternatively, you could try/catch around self.manager.logger.\n\ndef _finalize_durable\n    try:\n        with open() as _fp:\n            fsync\n        # Someone questioned this line here\n        fsync_dir\n    except (OSError, IOError) as err:\n        # We\u0027re clear on the error here\n        if err.errno \u003d\u003d errno.ENOSPC\n            msg \u003d \"No space left on device\" + err\n        if err.errno \u003d\u003d errno.EDQUOT\n            msg \u003d \"Quota exceeded\" + err\n        else\n            msg \u003d \"Problem opening file\" + err\n        # If self.manager.logger fails, it will raise an exception\n        self.manager.logger.error(msg)\n        raise DiskFileNoSpace(str(err))\n    except Exception as err:\n        # Catch other generic errors\n        msg \u003d \"Probem writing\" + err\n        # If self.manager.logger fails, it will raise an exception\n        self.manager.logger.error(msg)\n        raise DiskFileNoSpace(str(err))\n    \n    try:\n        self.manager.hash_cleanup_listdir(self._datadir)\n    except OSErorr as err:\n        self.manager.logger.exception(\"Problem cleaning\" + err)","commit_id":"92d5dd89fb01d5a9532423622de3fc1d5a5611aa"},{"author":{"_account_id":16896,"name":"Ondřej Nový","email":"novy@ondrej.org","username":"onovy"},"change_message_id":"7fc140938b5972b7989ba083daa820ff96c94dc8","unresolved":false,"context_lines":[{"line_number":2092,"context_line":"                        (durable_file_path, err))"},{"line_number":2093,"context_line":"                self.manager.logger.exception(msg)"},{"line_number":2094,"context_line":"                exc \u003d DiskFileError(msg)"},{"line_number":2095,"context_line":"\u003e\u003e\u003e\u003e\u003e\u003e\u003e 5dfb8d0... Error handling of DiskFileNoSpace()"},{"line_number":2096,"context_line":"        except Exception as err:"},{"line_number":2097,"context_line":"            msg \u003d (_(\u0027Problem writing durable state file %s (%s)\u0027) %"},{"line_number":2098,"context_line":"                   (durable_file_path, err))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_1190a542","line":2095,"updated":"2015-08-04 21:08:35.000000000","message":"commited unresolved conflict? :)","commit_id":"03fe2e2e29fc395cc7703ec09e8f505b1d1be811"},{"author":{"_account_id":17276,"name":"Carlos Cavanna","email":"ccavanna@ca.ibm.com","username":"ccavanna"},"change_message_id":"82f4bee376b43fbf9cd2c3ade3ab184a657408d8","unresolved":false,"context_lines":[{"line_number":2077,"context_line":"            self.manager.logger.exception(msg)"},{"line_number":2078,"context_line":"            exc \u003d DiskFileError(msg)"},{"line_number":2079,"context_line":"        if exc:"},{"line_number":2080,"context_line":"            raise exc"},{"line_number":2081,"context_line":""},{"line_number":2082,"context_line":"        try:"},{"line_number":2083,"context_line":"            self.manager.hash_cleanup_listdir(self._datadir)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a4dcd0f_1f8083f6","line":2080,"updated":"2015-08-05 14:30:43.000000000","message":"I know the code is written like this, but while we\u0027re changing it, Instead of:\nif exc:\n   raise exc\n\nI would raise the exception on the spot where we assign to exc.\nIt\u0027s clearer that way.","commit_id":"8dd7e11de8510bad49607fb06b5c1e98669e33e9"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"70caa0b39117c71381c7fac6aea16484b1bb3d13","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                    logging.exception(msg)"},{"line_number":155,"context_line":"                    raise DiskFileXattrNotSupported(e)"},{"line_number":156,"context_line":"            if e.errno in (errno.ENOSPC, errno.EDQUOT):"},{"line_number":157,"context_line":"                msg \u003d \"No space left on device for %s\" % _get_filename(fd)"},{"line_number":158,"context_line":"                logging.exception(msg)"},{"line_number":159,"context_line":"                raise DiskFileNoSpace(str(e))"},{"line_number":160,"context_line":"            raise"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_d4df0bd4","line":157,"updated":"2015-08-07 02:43:26.000000000","message":"should this msg be localized: _(...) ?","commit_id":"004fdb4ddefd5d945a93610a85c72de026e48e34"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"a253d773f1199c6b2a797bce3e5cca4b56bdd636","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            msg \u003d (_(\"Problem with writing metadata for %s (%s)\") %"},{"line_number":164,"context_line":"                   (_get_filename(fd), err))"},{"line_number":165,"context_line":"            logging.exception(msg)"},{"line_number":166,"context_line":"            raise DiskFileError(msg)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"def extract_policy(obj_path):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a8ffd7b_684899b3","line":166,"updated":"2015-11-30 08:44:23.000000000","message":"Did you see any exceptions not yet catched in this function?\nI\u0027m worried about raising a DiskFileError for any Exception besides IOError, hiding problems happening in this function.\n\nAs Pete said - there are a lot of other \"except Exception\" statements in the code, but adding more seems tricky to me.\n\nI\u0027m wondering if the logging might be enough, so replacing \"raise DiskFileError...\" with \"raise\" would be better - in that case the original Exception will be still raised.","commit_id":"94772028b8660be66f758e73f11e122d10de69cd"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"a253d773f1199c6b2a797bce3e5cca4b56bdd636","unresolved":false,"context_lines":[{"line_number":1862,"context_line":"            msg \u003d (_(\u0027Unexpected exception occurred while creating temporary \u0027"},{"line_number":1863,"context_line":"                     \u0027file with mkstemp() (%s)\u0027) % err)"},{"line_number":1864,"context_line":"            self._logger.exception(msg)"},{"line_number":1865,"context_line":"            raise DiskFileError(msg)"},{"line_number":1866,"context_line":"        dfw \u003d None"},{"line_number":1867,"context_line":"        try:"},{"line_number":1868,"context_line":"            if size is not None and size \u003e 0:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a8ffd7b_08ca2d1b","line":1865,"updated":"2015-11-30 08:44:23.000000000","message":"Same as above","commit_id":"94772028b8660be66f758e73f11e122d10de69cd"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"a253d773f1199c6b2a797bce3e5cca4b56bdd636","unresolved":false,"context_lines":[{"line_number":1876,"context_line":"                    msg \u003d (_(\u0027Unexpected exception occurred while trying to \u0027"},{"line_number":1877,"context_line":"                             \u0027fallocate() (%s)\u0027) % err)"},{"line_number":1878,"context_line":"                    self._logger.exception(msg)"},{"line_number":1879,"context_line":"                    raise DiskFileError(msg)"},{"line_number":1880,"context_line":"            dfw \u003d self.writer_cls(self._name, self._datadir, fd, tmppath,"},{"line_number":1881,"context_line":"                                  bytes_per_sync\u003dself._bytes_per_sync,"},{"line_number":1882,"context_line":"                                  threadpool\u003dself._threadpool,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a8ffd7b_e8d249d0","line":1879,"updated":"2015-11-30 08:44:23.000000000","message":"Again, same as above","commit_id":"94772028b8660be66f758e73f11e122d10de69cd"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"a253d773f1199c6b2a797bce3e5cca4b56bdd636","unresolved":false,"context_lines":[{"line_number":2118,"context_line":"        except OSError as os_err:"},{"line_number":2119,"context_line":"            self.manager.logger.error("},{"line_number":2120,"context_line":"                _(\u0027Problem cleaning up %s (%s)\u0027) %"},{"line_number":2121,"context_line":"                (self._datadir, os_err))"},{"line_number":2122,"context_line":""},{"line_number":2123,"context_line":"    def commit(self, timestamp):"},{"line_number":2124,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a8ffd7b_0866ad29","line":2121,"updated":"2015-11-30 08:44:23.000000000","message":"Now it gets even more trickey... Before this change, any non OSError-Exception would be catched too when calling hash_cleanup_listdir, raising a DiskFileError. This is no longer the case with the new code.\n\nI like that there is less masking now, but it\u0027s not straight anymore. Sometimes all Exceptions are catched (and masked), sometimes not. I\u0027m wondering if this might create new problems in the EC parts...","commit_id":"94772028b8660be66f758e73f11e122d10de69cd"}],"test/unit/obj/test_diskfile.py":[{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"855a285ac0f0c24ab02fa0c75a9ab18ac450757c","unresolved":false,"context_lines":[{"line_number":2534,"context_line":"            except DiskFileError:"},{"line_number":2535,"context_line":"                pass"},{"line_number":2536,"context_line":"            else:"},{"line_number":2537,"context_line":"                self.fail(\"Expected exception DiskFileError\")"},{"line_number":2538,"context_line":""},{"line_number":2539,"context_line":"    def test_create_mkstemp_no_space(self):"},{"line_number":2540,"context_line":"        df \u003d self.df_mgr.get_diskfile(self.existing_device, \u00270\u0027, \u0027abc\u0027, \u0027123\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_803d0adf","line":2537,"updated":"2015-08-11 18:08:03.000000000","message":"I believe that the previous seven lines simplify to:\n\n    self.assertRaises(DiskFileError, df.create, size\u003d200)","commit_id":"810a2456c631acf768ec08ff703d18a89313d52b"},{"author":{"_account_id":13104,"name":"Minwoo Bae","email":"minwoob@us.ibm.com","username":"minwoob"},"change_message_id":"162d567c7d261fcda5e287c76cb703d3a3cac1ba","unresolved":false,"context_lines":[{"line_number":2534,"context_line":"            except DiskFileError:"},{"line_number":2535,"context_line":"                pass"},{"line_number":2536,"context_line":"            else:"},{"line_number":2537,"context_line":"                self.fail(\"Expected exception DiskFileError\")"},{"line_number":2538,"context_line":""},{"line_number":2539,"context_line":"    def test_create_mkstemp_no_space(self):"},{"line_number":2540,"context_line":"        df \u003d self.df_mgr.get_diskfile(self.existing_device, \u00270\u0027, \u0027abc\u0027, \u0027123\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa1b9901_d25ef344","line":2537,"in_reply_to":"1a4dcd0f_803d0adf","updated":"2015-08-17 19:45:58.000000000","message":"Not quite. This causes it to fail. It looks like the issue is that df.create() is successful.","commit_id":"810a2456c631acf768ec08ff703d18a89313d52b"},{"author":{"_account_id":13104,"name":"Minwoo Bae","email":"minwoob@us.ibm.com","username":"minwoob"},"change_message_id":"acbda2a3e8f819bd7354596b950ecd5255daf2f8","unresolved":false,"context_lines":[{"line_number":2534,"context_line":"            except DiskFileError:"},{"line_number":2535,"context_line":"                pass"},{"line_number":2536,"context_line":"            else:"},{"line_number":2537,"context_line":"                self.fail(\"Expected exception DiskFileError\")"},{"line_number":2538,"context_line":""},{"line_number":2539,"context_line":"    def test_create_mkstemp_no_space(self):"},{"line_number":2540,"context_line":"        df \u003d self.df_mgr.get_diskfile(self.existing_device, \u00270\u0027, \u0027abc\u0027, \u0027123\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa1b9901_8376eb3c","line":2537,"in_reply_to":"fa1b9901_c5d14bfd","updated":"2015-08-17 20:40:46.000000000","message":"No worries - thank you for the suggestion.","commit_id":"810a2456c631acf768ec08ff703d18a89313d52b"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"0106602be819da30dd33c2d04d7a7aaa546354ca","unresolved":false,"context_lines":[{"line_number":2534,"context_line":"            except DiskFileError:"},{"line_number":2535,"context_line":"                pass"},{"line_number":2536,"context_line":"            else:"},{"line_number":2537,"context_line":"                self.fail(\"Expected exception DiskFileError\")"},{"line_number":2538,"context_line":""},{"line_number":2539,"context_line":"    def test_create_mkstemp_no_space(self):"},{"line_number":2540,"context_line":"        df \u003d self.df_mgr.get_diskfile(self.existing_device, \u00270\u0027, \u0027abc\u0027, \u0027123\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa1b9901_c5d14bfd","line":2537,"in_reply_to":"fa1b9901_d25ef344","updated":"2015-08-17 20:00:48.000000000","message":"Oh, that\u0027d make sense; it\u0027s the __enter__ or __exit__ of what df.create() returns that\u0027s raising an exception.\n\nIn that case, this still simplifies some:\n\n    with mock.patch(\u0027swift.obj....\u0027), self.assertRaises(DiskFileError):\n        with df.create(size\u003d200):\n            pass\n\nOf course, you might be able to combine all three, but personally I like the double-nesting. The order of the mock and assertRaises don\u0027t matter, but this makes sure they\u0027re both in place before df.create(), its __enter__, or its __exit__ gets called. Combining them would make me think about the order of evaluation of those things, and I don\u0027t want to do that. :)\n\n(And this time I even tried it locally before shooting my mouth off. ;) )","commit_id":"810a2456c631acf768ec08ff703d18a89313d52b"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"855a285ac0f0c24ab02fa0c75a9ab18ac450757c","unresolved":false,"context_lines":[{"line_number":2574,"context_line":"            except DiskFileError:"},{"line_number":2575,"context_line":"                pass"},{"line_number":2576,"context_line":"            else:"},{"line_number":2577,"context_line":"                self.fail(\"Expected exception DiskFileError\")"},{"line_number":2578,"context_line":""},{"line_number":2579,"context_line":"    def test_create_close_oserror(self):"},{"line_number":2580,"context_line":"        df \u003d self.df_mgr.get_diskfile(self.existing_device, \u00270\u0027, \u0027abc\u0027, \u0027123\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_202756cb","line":2577,"updated":"2015-08-11 18:08:03.000000000","message":"same as above","commit_id":"810a2456c631acf768ec08ff703d18a89313d52b"}]}
