<div dir="ltr"><div><div>I think the auto-cancel will be an unexpected side-effect. For instance a user who wants an importer/publisher change to occur after a sync is done. (retelling @asmacdo's argument here) Auto-canceling would require the user to monitor for the sync task instead of just firing them in the order the user wants Pulp to handle them.<br><br>+1 for the asynchronous update and delete operations for importers/publishers. It gives a transactional like experience for plugin writers which is really nice. For synchronous deletes having the plugin writer not being able to 
rely on the data layer being consistent during the sync or publish does not sound good. Having it error in random places due to a synchronous delete doesn't sound like a good user experience either.<br><br></div><div>For the [SYNC][SYNC][SYNC[DEL] case the user can issue explicit cancels if they want the delete to be handled immediately. They have everything they need to get the behaviors they want out of Pulp.<br></div><div><br></div>Also there are write-write concern with synchronous updates. The importer read at the beginning of a sync could then cause a write which would overwrite a synchronous update done via the API.<br><br></div>These are some of the reasons that make me thing asynchronous update and delete operations on publishers, importers, and repositories are the way to go.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 17, 2017 at 4:03 PM, Austin Macdonald <span dir="ltr"><<a href="mailto:austin@redhat.com" target="_blank">austin@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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. </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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></blockquote><div><br></div></span><div>I assumed the opposite. If I issue 3 syncs and then a delete, I wouldn't expect the syncs to be canceled. If we do decide to go with synchronous update/delete, we have to account for the possibility that the content adapter has been modified or removed through the whole sync and publish process. I think that would force us to disallow (or just a strongly worded note) warning them not to reload or save content adapter instances, or else they will be susceptible to race conditions. Because the plugin writer is now responsible for handling race conditions and failing gracefully, I I am thinking that it will not be simpler.</div><span class=""><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">2. Getting a 201 on a resource delete/update seems odd from the REST point of view.</span></blockquote><div><br></div></span><div>Yeah :( <br></div><div><br></div><div>I am -0 on synchronous calls at the moment but I could be convinced otherwise. I think of this primarily as balancing predictability vs performance.</div></div></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></div>