<div dir="ltr">That's a very likable approach. Delete immediately and auto-cancel any tasks queued or in progress. It's simple.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 17, 2017 at 3:22 PM, Jeff Ortel <span dir="ltr"><<a href="mailto:jortel@redhat.com" target="_blank">jortel@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm still in favor of having both update and delete operations synchronous for these reasons:<br>
<br>
1. Simpler.<br>
2. Getting a 201 on a resource delete/update seems odd from the REST point of view.<br>
3. We want update/delete to be immediate and we'd want any task in progress to discontinue as soon as<br>
possible.  Basically, error out.<br>
4. Image these tasks queued up [SYNC][SYNC][SYNC][DEL] ... we'd waste a ton of cycles syncing a repo that the<br>
user wants to delete.  And, the delete get's delayed by hours.  Not what the user intended.<br>
<br>
<br>
On 04/17/2017 12:55 PM, Michael Hrivnak wrote:<br>
<div class="HOEnZb"><div class="h5">><br>
><br>
> On Mon, Apr 17, 2017 at 1:26 PM, Brian Bouterse <<a href="mailto:bbouters@redhat.com">bbouters@redhat.com</a> <mailto:<a href="mailto:bbouters@redhat.com">bbouters@redhat.com</a>>> wrote:<br>
><br>
>     @asmacdo, your points cause me to also think that all importer/publisher update and delete operations<br>
>     should be tasks that use the tasking reservations system. That will cause them to never run while a sync<br>
>     or publish for instance is running. I'm interested in hearing more thoughts on this from others.<br>
><br>
><br>
> Doing updates and deletes in tasks keeps the Pulp 2 behavior, which is safe and reasonably well-understood.<br>
> That's a fine way to go.<br>
><br>
> I think the delete is especially advantageous to do in a task, so the object never disappears while an import<br>
> or publish related task is running.<br>
><br>
> Update is easier to do synchronously. If it's a task, we have to worry about saving a diff for the object<br>
> (presumably as an argument to the task), then applying that diff in the running task and validating it the way<br>
> the REST API would. That's doable, but we'd have to do it. :) It's very tempting to do it synchronously and<br>
> let the REST API do what it does for free.<br>
><br>
> That said, just because it's the easy option doesn't mean it's the right one. Doing the update synchronously,<br>
> as has been pointed out, allows for the possibility that the importer config will change between when the task<br>
> is queued and when it runs. I think that's fine and reasonable, but it could be seen as a downside.<br>
><br>
> Consider that while doing an update in a task could be more predictable in one way, it could also create its<br>
> own confusion. Consider an API user who sees a representation of an importer in the DB and submits changes to<br>
> it, but doesn't realize there are already other changes queued as tasks.<br>
><br>
> Neither approach seems perfect, but I lean toward synchronous updates to avoid the diff+validation challenge<br>
> and the (potentially very long) delay in changes being visible.<br>
><br>
><br>
><br>
>     A related question... are importers or publishers ever shared with multiple repos in Pulp3?<br>
><br>
><br>
> Nope.<br>
><br>
><br>
> --<br>
><br>
> Michael Hrivnak<br>
><br>
> Principal Software Engineer, RHCE<br>
><br>
> Red Hat<br>
><br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> Pulp-dev mailing list<br>
> <a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
><br>
<br>
</div></div><br>______________________________<wbr>_________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important"><span style="margin:0px!important;padding:0px!important">Michael</span> <span style="margin:0px!important;padding:0px!important">Hrivnak</span></p><p style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important"></p><span style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important"><span style="margin:0px!important;padding:0px!important">Principal Software Engineer</span><span style="margin:0px!important;padding:0px!important">, <span style="margin:0px!important;padding:0px!important">RHCE</span></span> </span><span style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px"></span><br style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important"><p style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important">Red Hat</p></div></div>
</div>