Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[irods#124] Use "target" for redis_lock key in create_dirs
The create_dirs function recursively creates all collections and subcollections for a particular path. This is made safe from concurrent collection creation through the use of redis_lock.Lock. Each descent into the collection's subcollections means acquiring a lock for that subcollection until it reaches a collection which already exists. This is the base case. If the number of elements in the object name "path" (including "/" and the bucket name) is fewer than the number of subcollections to check, it can get stuck because it runs out of path elements to use for unique lock names. This change uses the collection for the redis_lock key rather than the path. In this way the path elements will never run out.
- Loading branch information