Project

Profile

Help

Story #3044

Updated by jortel@redhat.com almost 6 years ago

To prevent race conditions related to base_path checking, Like other repository-related objects, Distribution CRUD operations need to be done asynchronously under the protection of resource locking. updates should dispatch tasks and return 202s. 

 The plan: To do this, we can either: 
 * The locked resource will be a _string_ name of the model: _"Distribution"_. 1. Create an file for distribution tasks in platform/pulpcore/app/tasks/distribution.py 
 * The base_path checking needs to be moved from the serializer to the model. 
 * Create a new _AsyncCreateMixin_ following the same pattern as 2. Add update & and delete mixins. tasks 
 * The DistributionViewSet will use the _AsyncUpdateMixin_, _AsyncDeleteMixin_, 3. Override update and _AsyncCreateMixin_ 
 destroy methods of Distribution ViewSet 

 Or we can get this behavior for free after https://pulp.plan.io/issues/3038

Back