<div dir="ltr">ReservedResources are unique[0] and the tasking code relies on this uniqueness to prevent race conditions[1]. The db transaction prevents two workers from acquiring a lock on the same resource. I read through 5120 but I am not sure how the design would prevent that from happening?<div><br><div><div>[0] <a href="https://github.com/pulp/pulpcore/blob/master/pulpcore/app/models/task.py#L35">https://github.com/pulp/pulpcore/blob/master/pulpcore/app/models/task.py#L35</a></div><div>[1] <a href="https://github.com/pulp/pulpcore/blob/ae6be0d89c5df26ac1cfdc876f3b131aa6e9bcf8/pulpcore/app/models/task.py#L229-L246">https://github.com/pulp/pulpcore/blob/ae6be0d89c5df26ac1cfdc876f3b131aa6e9bcf8/pulpcore/app/models/task.py#L229-L246</a><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div><div>David<br></div></div></div></div></div></div></div></div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 11, 2019 at 4:04 PM Dennis Kliban <<a href="mailto:dkliban@redhat.com">dkliban@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I just wrote up a story to add an ability to filter Tasks by the resources that they reserved. This is needed for the migration plan tasks and will be just as useful for other tasks. <br></div><div><br></div><div>The design requires storing ReservedResources permanently in the database. The status of the task associated with the ReservedResource will be used to determine if a ReservedResource is still active or not. Additionally it will no longer be necessary to dispatch a task for removing the ReservedResource. Pulp will no longer have to dispatch 2 tasks for every single task with a reservation. <br></div><div><br></div>What questions or concerns do you have?<br><div><br></div><div></div><div>[0] <a href="https://pulp.plan.io/issues/5120" target="_blank">https://pulp.plan.io/issues/5120</a></div></div>
_______________________________________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-dev</a><br>
</blockquote></div>