)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"165cad3ac0b33070d5d0f783c1f5f0e1b50e1a0c","unresolved":false,"context_lines":[{"line_number":10,"context_line":"files per volume. The problem can\u0027t easily be solved in the locking"},{"line_number":11,"context_line":"library because it\u0027s not trivial to tell when no processes are waiting for a"},{"line_number":12,"context_line":"lock. Instead, this change groups all lock files for a volume into a single"},{"line_number":13,"context_line":"directory, and periodically checks which volumes have been deleted and removes"},{"line_number":14,"context_line":"its lock directory."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I53ca7962f051aa5154cd32e45a5f3b187eb7dbb2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a26ad4f_9ee2ab02","line":13,"updated":"2015-10-28 18:27:19.000000000","message":"Lines should be wrapped at 72 characters. \n\nhttps://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_Git_commit_message_structure","commit_id":"500939194a4f243541536bbcdc66b8ce2b10cde5"}],"cinder/volume/manager.py":[{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"cfa5ce9c020e8ce9a1106009e3a62cbe80ba1146","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        # Keeps track of volumes which have been deleted but the lockfiles"},{"line_number":220,"context_line":"        # haven\u0027t been cleaned up yet"},{"line_number":221,"context_line":"        self._locks_to_cleanup \u003d {}"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        if not volume_driver:"},{"line_number":224,"context_line":"            # Get from configuration, which will get the default"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_9d2b7e94","line":221,"updated":"2015-10-29 10:12:12.000000000","message":"So if the service restart, this dict will be clean, right? Could we load this dict from DB?","commit_id":"d85057c86fb7332568c10c261bf187cc2a710710"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"eed00151d5dcd17d89a8e910d59b77b3106defc9","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        # Keeps track of volumes which have been deleted but the lockfiles"},{"line_number":220,"context_line":"        # haven\u0027t been cleaned up yet"},{"line_number":221,"context_line":"        self._locks_to_cleanup \u003d {}"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        if not volume_driver:"},{"line_number":224,"context_line":"            # Get from configuration, which will get the default"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_d65a2b83","line":221,"in_reply_to":"1a26ad4f_9d2b7e94","updated":"2015-10-29 16:38:24.000000000","message":"We could load this from the DB, the complication would be iterating over all the volumes could be a pretty costly operation.  The way I\u0027d imagine it would be something like:\n\nLook through all existing lock directories, and then delete all lock-directories where the volume has been deleted (would have to query DB here)\n\nThis would mean we\u0027re iterating over all the lock dirs (about equal to current # of volumes) - so this would be much slower, especially in an a large environment with many volumes.   Not sure if we\u0027d only want to do this in init_host as opposed to a periodic task.\n\n\nI wanted to clean up locks while cinder was still running which is why I made it a periodic task, and not make it a costly operation like iterating over all volumes.  At most, currently we\u0027d strand lock files for the # of volumes deleted in the last two minutes.\n\n\nHowever, I still think this is a reasonable suggestion, so if you think it\u0027s reasonable I can add a function that checks against DB volumes and iterates over existing lock files in \"init_host\", which will be in addition to the existing setup, and will catch any of the orphaned lock files that would occur from a cinder-volume node crashing soon after deleting a volume?","commit_id":"d85057c86fb7332568c10c261bf187cc2a710710"},{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"b5f675159c6164c39119867311a759c97466bee3","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        # Keeps track of volumes which have been deleted but the lockfiles"},{"line_number":220,"context_line":"        # haven\u0027t been cleaned up yet"},{"line_number":221,"context_line":"        self._locks_to_cleanup \u003d {}"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        if not volume_driver:"},{"line_number":224,"context_line":"            # Get from configuration, which will get the default"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_251d5ebd","line":221,"in_reply_to":"1a26ad4f_d65a2b83","updated":"2015-10-30 01:37:53.000000000","message":"Thanks for explaining the detail. I totally agree with you that it will be time-consuming if we load this dict from DB, especially in a large deployment.\nI think it could be an enhancement based on you current change if we can find a way to handle this issue, but it is not necessary in this patch.\nI just want to point out this issue. Overall it looks good to me. :)","commit_id":"d85057c86fb7332568c10c261bf187cc2a710710"},{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"cfa5ce9c020e8ce9a1106009e3a62cbe80ba1146","unresolved":false,"context_lines":[{"line_number":2312,"context_line":"                shutil.rmtree(vol_lock_path, ignore_errors\u003dTrue)"},{"line_number":2313,"context_line":"            else:"},{"line_number":2314,"context_line":"                # Hold onto ids of volumes which are not old enough to have"},{"line_number":2315,"context_line":"                # have their locks deleted"},{"line_number":2316,"context_line":"                _skipped_locks[vol_id] \u003d self._locks_to_cleanup[vol_id]"},{"line_number":2317,"context_line":""},{"line_number":2318,"context_line":"        self._locks_to_cleanup \u003d _skipped_locks"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_3defca88","line":2315,"updated":"2015-10-29 10:12:12.000000000","message":"duplicated \u0027have\u0027","commit_id":"d85057c86fb7332568c10c261bf187cc2a710710"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"eed00151d5dcd17d89a8e910d59b77b3106defc9","unresolved":false,"context_lines":[{"line_number":2312,"context_line":"                shutil.rmtree(vol_lock_path, ignore_errors\u003dTrue)"},{"line_number":2313,"context_line":"            else:"},{"line_number":2314,"context_line":"                # Hold onto ids of volumes which are not old enough to have"},{"line_number":2315,"context_line":"                # have their locks deleted"},{"line_number":2316,"context_line":"                _skipped_locks[vol_id] \u003d self._locks_to_cleanup[vol_id]"},{"line_number":2317,"context_line":""},{"line_number":2318,"context_line":"        self._locks_to_cleanup \u003d _skipped_locks"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a26ad4f_96559351","line":2315,"in_reply_to":"1a26ad4f_3defca88","updated":"2015-10-29 16:38:24.000000000","message":"Good catch","commit_id":"d85057c86fb7332568c10c261bf187cc2a710710"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"99d33450cc6a63b30014bce5615b8c8ed14b232e","unresolved":false,"context_lines":[{"line_number":2320,"context_line":""},{"line_number":2321,"context_line":"        self._locks_to_cleanup \u003d _skipped_locks"},{"line_number":2322,"context_line":""},{"line_number":2323,"context_line":"    def is_lock_old_enough_to_cleanup(self, cur_time, vol_deletion_time):"},{"line_number":2324,"context_line":"        time_delta_since_delete \u003d cur_time - vol_deletion_time"},{"line_number":2325,"context_line":"        # Leave some time for processes waiting on lock for deleted volume to"},{"line_number":2326,"context_line":"        # clear through the pipe"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a26ad4f_bf84ce0a","line":2323,"updated":"2015-11-02 19:38:27.000000000","message":"This should be a private method - otherwise it becomes an RPC method of cinder-volume.","commit_id":"4f0eb1bdc07ac0313d53e921598589fdec8091aa"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"0c239d6c6cb373bd996735726fc3e7a613047334","unresolved":false,"context_lines":[{"line_number":2320,"context_line":""},{"line_number":2321,"context_line":"        self._locks_to_cleanup \u003d _skipped_locks"},{"line_number":2322,"context_line":""},{"line_number":2323,"context_line":"    def is_lock_old_enough_to_cleanup(self, cur_time, vol_deletion_time):"},{"line_number":2324,"context_line":"        time_delta_since_delete \u003d cur_time - vol_deletion_time"},{"line_number":2325,"context_line":"        # Leave some time for processes waiting on lock for deleted volume to"},{"line_number":2326,"context_line":"        # clear through the pipe"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a26ad4f_fa6494b9","line":2323,"in_reply_to":"1a26ad4f_bf84ce0a","updated":"2015-11-02 20:01:46.000000000","message":"Thanks for the info - will fix this.","commit_id":"4f0eb1bdc07ac0313d53e921598589fdec8091aa"}]}
