Task #6677
Updated by pulpbot about 3 years ago
**Ticket moved to GitHub**: "pulp/pulp_ansible/709":https://github.com/pulp/pulp_ansible/issues/709 ---- ## Background The [import_collection task](https://github.com/pulp/pulp_ansible/blob/00450c9b7512df50ae02b6dfa3384092e5c37a66/pulp_ansible/app/tasks/collections.py#L84) both analyzes a collection [here](https://github.com/pulp/pulp_ansible/blob/00450c9b7512df50ae02b6dfa3384092e5c37a66/pulp_ansible/app/tasks/collections.py#L127-L136) and then creates content and adds it to a repository version [here](https://github.com/pulp/pulp_ansible/blob/00450c9b7512df50ae02b6dfa3384092e5c37a66/pulp_ansible/app/tasks/collections.py#L140-L184). ## Problem The import_collection runs long enough that to import a lot of content into a repository serializes these long tasks making the whole workload take long. It takes longer than it should because the collection analysis portion of the task runtime takes the majority of the time and the lock on repository is not needed during that. The lock is only needed when creating the RepositoryVersion itself. ## Solution 1. Split import_collection into two tasks. analyze_and_create_collection and then add_collection_to_repository. 2. Have the analyze_and_create_collection task dispatch the add_collection_to_repository. The analyze_and_create_collection task requires no lock. The add_collection_to_respository should have the lock on the repository.