)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"2a82486d33e7a1b5bde6e1402ba1b3f112dfe546","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Multiple calls can get the same device. This patch adds synchronization"},{"line_number":10,"context_line":"to create_volume, delete_volume and create_cloned_volume to avoid race"},{"line_number":11,"context_line":"conditions. The delete_volume method is modified to avoid code duplication"},{"line_number":12,"context_line":"in the implementation delete_snapshot method for snapshot in the next"},{"line_number":13,"context_line":"patch. Also it adds update provider_location and host to mark device as"},{"line_number":14,"context_line":"used to avoid race with other threads. It uses object notation instead"},{"line_number":15,"context_line":"of dict notation to a volume and snapshot."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"7a740942_bf024ab2","line":12,"updated":"2015-12-08 19:35:12.000000000","message":"in the implementation of delete_snapshot method\n\n(if I understand the sentence correctly ;))","commit_id":"e71d43b9c37bcb8f983796f8e280e9028155ab52"}],"cinder/tests/unit/test_block_device.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"2a82486d33e7a1b5bde6e1402ba1b3f112dfe546","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            host\u003d\u0027localhost\u0027, db\u003ddb)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def test_initialize_connection(self):"},{"line_number":44,"context_line":"        TEST_VOLUME1 \u003d obj_volume.Volume(host\u003d\u0027localhost1\u0027,"},{"line_number":45,"context_line":"                                         provider_location\u003d\u00271 2 3 /dev/loop1\u0027,"},{"line_number":46,"context_line":"                                         provider_auth\u003d\u0027a b c\u0027,"},{"line_number":47,"context_line":"                                         attached_mode\u003d\u0027rw\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a740942_dfeb96da","line":44,"updated":"2015-12-08 19:35:12.000000000","message":"Sometimes it may be easier to use cinder.tests.unit.fake_volume, but this approach is also totally correct. :)","commit_id":"e71d43b9c37bcb8f983796f8e280e9028155ab52"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"5a77e1959b628f8b861599536c51711ba0ec6909","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        def fake_local_path(vol):"},{"line_number":239,"context_line":"            return vol[\u0027provider_location\u0027].split()[-1]"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        with mock.patch.object(obj_volume.VolumeList, \u0027get_all_by_host\u0027,"},{"line_number":242,"context_line":"                               return_value\u003d[TEST_VOLUME1, TEST_VOLUME2]):"},{"line_number":243,"context_line":"            with mock.patch.object(context, \u0027get_admin_context\u0027):"},{"line_number":244,"context_line":"                with mock.patch.object(self.drv, \u0027local_path\u0027,"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_230298b5","line":241,"updated":"2015-12-09 13:23:59.000000000","message":"SnapshotList should be mocked too","commit_id":"e03a312b97fab3083841f436ead3f2a68307cea4"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"4e9831c447f5d38c904193be165611de149aeeb8","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        TEST_VOLUME \u003d obj_volume.Volume(name_id\u003d\u00271234\u0027,"},{"line_number":123,"context_line":"                                        size\u003d1,"},{"line_number":124,"context_line":"                                        display_name\u003d\u0027vol1\u0027)"},{"line_number":125,"context_line":"        with mock.patch.object(obj_volume.Volume, \u0027save\u0027) as save_mocked:"},{"line_number":126,"context_line":"            self.drv._update_provider_location(TEST_VOLUME, \u0027dev_path\u0027)"},{"line_number":127,"context_line":"            save_mocked.assert_called_once_with()"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"7a740942_47009466","line":125,"updated":"2015-12-11 11:34:41.000000000","message":"It will be good to check volume.update call too.","commit_id":"6bcd4f2d87535edad92bf7c4c77bb113b93eab10"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"4e9831c447f5d38c904193be165611de149aeeb8","unresolved":false,"context_lines":[{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        with mock.patch.object(obj_volume.VolumeList, \u0027get_all_by_host\u0027,"},{"line_number":246,"context_line":"                               return_value\u003d[TEST_VOLUME1, TEST_VOLUME2]),\\"},{"line_number":247,"context_line":"                mock.patch.object(obj_snap.SnapshotList, \u0027get_by_host\u0027,"},{"line_number":248,"context_line":"                                  return_value\u003d[TEST_SNAP]):"},{"line_number":249,"context_line":"            with mock.patch.object(context, \u0027get_admin_context\u0027):"},{"line_number":250,"context_line":"                with mock.patch.object(self.drv, \u0027local_path\u0027,"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a740942_87667c4f","line":247,"updated":"2015-12-11 11:34:41.000000000","message":"No need to create fake snapshot if it is not used. Also, this test has invalid data, because volume and snapshot are both located on the same device /dev/loop1","commit_id":"6bcd4f2d87535edad92bf7c4c77bb113b93eab10"}],"cinder/volume/drivers/block_device.py":[{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"b8dff6a855a28fd005fda5c09202bd51e4b05e76","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                volume_clear\u003dself.configuration.volume_clear,"},{"line_number":90,"context_line":"                volume_clear_size\u003dself.configuration.volume_clear_size)"},{"line_number":91,"context_line":"        else:"},{"line_number":92,"context_line":"            LOG.warning(_LW(\"Volume clearing is disabled. \""},{"line_number":93,"context_line":"                            \"Something has gone wrong.\"))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        if device[\u0027status\u0027] \u003d\u003d \"error_deleting\":"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_ce9423ea","line":92,"updated":"2015-12-03 15:07:08.000000000","message":"This warning message doesn\u0027t make sense to me.  First, you could get here if the dev_path doesn\u0027t exist so it doesn\u0027t make sense.  Also, I think a better description of the impact of the situation is necessary.  I.E. the device won\u0027t be cleared?","commit_id":"187f85941440523700e064ba4b1883a810fec8ef"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"a49080b6758bc6d333f81086cff4306a0d7c708f","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        volume.update({\u0027provider_location\u0027: device, \u0027host\u0027: self.host})"},{"line_number":69,"context_line":"        volume.save()"},{"line_number":70,"context_line":"        return {"},{"line_number":71,"context_line":"            \u0027provider_location\u0027: device,"},{"line_number":72,"context_line":"        }"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a740942_bf7ef116","line":71,"updated":"2015-12-08 08:08:25.000000000","message":"Why would you still return updates to the manager if you already updated the DB? This will trigger second update in the manager, which will be unnecessary. Take a look into create_volume flow [1].\n\nI\u0027m not sure we want to have driver calling the DB directly, but this should fix the race conditions…\n\n[1] https://github.com/openstack/cinder/blob/master/cinder/volume/flows/manager/create_volume.py#L818-L851","commit_id":"05f155862128532ddeeaf8e80acbeaf981bb3a41"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"96c38d3e13a5d21e2cab708080ab6c79aa0081e3","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        pass"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _update_provider_location(self, volume, device):"},{"line_number":66,"context_line":"        # We update provider_location and host to mark device in use to"},{"line_number":67,"context_line":"        # avoid race with other threads."},{"line_number":68,"context_line":"        volume.update({\u0027provider_location\u0027: device, \u0027host\u0027: self.host})"},{"line_number":69,"context_line":"        volume.save()"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_1085af05","line":66,"updated":"2015-12-08 10:08:57.000000000","message":"not: mark device as in use","commit_id":"f71b1ee276c38880200a3164b7ec56a0d837d68e"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"96c38d3e13a5d21e2cab708080ab6c79aa0081e3","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":74,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s\"),"},{"line_number":75,"context_line":"                 {\"volume\": volume[\u0027name\u0027], \"device\": device})"},{"line_number":76,"context_line":"        self._update_provider_location(volume, device)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":79,"context_line":"    def delete_volume(self, volume):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_3091cb47","line":76,"updated":"2015-12-08 10:08:57.000000000","message":"This will return None. I don\u0027t think it\u0027s a problem though.","commit_id":"f71b1ee276c38880200a3164b7ec56a0d837d68e"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"96c38d3e13a5d21e2cab708080ab6c79aa0081e3","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    def _devices_sizes(self):"},{"line_number":198,"context_line":"        available_devices \u003d self.configuration.available_devices"},{"line_number":199,"context_line":"        return self._get_devices_sizes(available_devices)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def find_appropriate_size_device(self, size):"},{"line_number":202,"context_line":"        dict_of_devices_sizes \u003d self._devices_sizes()"},{"line_number":203,"context_line":"        free_devices \u003d (set(self.configuration.available_devices) -"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_d0a2c798","line":200,"updated":"2015-12-08 10:08:57.000000000","message":"It\u0027s not related to the patch, but shouldn\u0027t this be private method?","commit_id":"f71b1ee276c38880200a3164b7ec56a0d837d68e"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"96c38d3e13a5d21e2cab708080ab6c79aa0081e3","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        else:"},{"line_number":220,"context_line":"            raise exception.CinderException(_(\"No big enough free disk\"))"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":223,"context_line":"    def extend_volume(self, volume, new_size):"},{"line_number":224,"context_line":"        dev_path \u003d self.local_path(volume)"},{"line_number":225,"context_line":"        total_size \u003d self._get_devices_sizes([dev_path])"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_90a8bf78","line":222,"updated":"2015-12-08 10:08:57.000000000","message":"I don\u0027t think you need to lock this method. You don\u0027t use find_appropriate_size_device here. Am I missing something?","commit_id":"f71b1ee276c38880200a3164b7ec56a0d837d68e"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"2a82486d33e7a1b5bde6e1402ba1b3f112dfe546","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        lst \u003d objects.VolumeList.get_all_by_host(context.get_admin_context(),"},{"line_number":178,"context_line":"                                                 self.host)"},{"line_number":179,"context_line":"        used_devices \u003d self._get_used_items(lst)"},{"line_number":180,"context_line":"        snp_lst \u003d objects.SnapshotList.get_by_host(context.get_admin_context(),"},{"line_number":181,"context_line":"                                                   self.host)"},{"line_number":182,"context_line":"        return used_devices.union(self._get_used_items(snp_lst))"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7a740942_5fea4675","line":180,"updated":"2015-12-08 19:35:12.000000000","message":"If this patch doesn\u0027t add snapshot support to BlockDeviceDriver, shouldn\u0027t this be added in the second patch?","commit_id":"e71d43b9c37bcb8f983796f8e280e9028155ab52"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"5a77e1959b628f8b861599536c51711ba0ec6909","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":72,"context_line":"    def create_volume(self, volume):"},{"line_number":73,"context_line":"        device \u003d self.find_appropriate_size_device(volume.size)"},{"line_number":74,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s\"),"},{"line_number":75,"context_line":"                 {\"volume\": volume.name, \"device\": device})"},{"line_number":76,"context_line":"        self._update_provider_location(volume, device)"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_83e34c05","line":74,"updated":"2015-12-09 13:23:59.000000000","message":"nit: Creating","commit_id":"e03a312b97fab3083841f436ead3f2a68307cea4"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"5a77e1959b628f8b861599536c51711ba0ec6909","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                volume_clear\u003dself.configuration.volume_clear,"},{"line_number":95,"context_line":"                volume_clear_size\u003dself.configuration.volume_clear_size)"},{"line_number":96,"context_line":"        else:"},{"line_number":97,"context_line":"            LOG.warning(_LW(\"The device won\u0027t be cleared.\"))"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if device.status \u003d\u003d \"error_deleting\":"},{"line_number":100,"context_line":"            msg \u003d _(\"Failed to delete device.\")"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_63cd0086","line":97,"updated":"2015-12-09 13:23:59.000000000","message":"Please, add device name to the log message","commit_id":"e03a312b97fab3083841f436ead3f2a68307cea4"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"5a77e1959b628f8b861599536c51711ba0ec6909","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        self._stats \u003d data"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def _get_used_items(self, lst):"},{"line_number":169,"context_line":"        used_dev \u003d set()"},{"line_number":170,"context_line":"        for item in lst:"},{"line_number":171,"context_line":"            local_path \u003d self.local_path(item)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_23e61845","line":168,"updated":"2015-12-09 13:23:59.000000000","message":"Please, provide a more useful name for method and param in the next patch","commit_id":"e03a312b97fab3083841f436ead3f2a68307cea4"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"4e9831c447f5d38c904193be165611de149aeeb8","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _update_provider_location(self, object, device):"},{"line_number":66,"context_line":"        # We update provider_location and host to mark device as used to"},{"line_number":67,"context_line":"        # avoid race with other threads."},{"line_number":68,"context_line":"        object.update({\u0027provider_location\u0027: device, \u0027host\u0027: self.host})"},{"line_number":69,"context_line":"        object.save()"},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"7a740942_47a17445","line":67,"updated":"2015-12-11 11:34:41.000000000","message":"Please, add comment like:\n# TODO (nickname): remove DB access from driver","commit_id":"6bcd4f2d87535edad92bf7c4c77bb113b93eab10"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"4e9831c447f5d38c904193be165611de149aeeb8","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        \"\"\"Deletes a logical volume.\"\"\""},{"line_number":81,"context_line":"        self._delete_block_device(volume)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _delete_block_device(self, device):"},{"line_number":84,"context_line":"        \"\"\"Deletes a block device.\"\"\""},{"line_number":85,"context_line":"        dev_path \u003d self.local_path(device)"},{"line_number":86,"context_line":"        if not dev_path or dev_path not in \\"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a740942_87c2fce7","line":83,"updated":"2015-12-11 11:34:41.000000000","message":"Actually, this method doesn\u0027t delete block dev. It clears it. Please, rename","commit_id":"6bcd4f2d87535edad92bf7c4c77bb113b93eab10"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"67c4b0d806d11a8393b66f7ae118f28785c0bcc6","unresolved":false,"context_lines":[{"line_number":76,"context_line":"                 {\"volume\": volume.name, \"device\": device})"},{"line_number":77,"context_line":"        self._update_provider_location(volume, device)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":80,"context_line":"    def delete_volume(self, volume):"},{"line_number":81,"context_line":"        \"\"\"Deletes a logical volume.\"\"\""},{"line_number":82,"context_line":"        self._clear_block_device(volume)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a740942_5af494ef","line":79,"updated":"2015-12-14 13:21:57.000000000","message":"Do you need to synchronize that method? You\u0027re not using find_appropriate_size_device, so why is it necessary?","commit_id":"0dba36b8af37b9b0ac5a3c11ff0734de5b2aa594"}]}
