<div dir="ltr">You can still attempt to cancel a task.  This email is specifically about interruption though.  Let me explain the nuances in a bit more detail.<div><br></div><div>With the suggestion we would still fully support if the task hasn&#39;t yet started that it would be cancellable.<br><div><br></div><div>However when you cancel a task, there is an <span style="color:rgb(53,56,51);font-family:&#39;DejaVu Sans Mono&#39;,monospace;font-size:14px;line-height:19.6px">mayInterruptIfRunning </span>boolean<span style="color:rgb(53,56,51);font-family:&#39;DejaVu Sans Mono&#39;,monospace;font-size:14px;line-height:19.6px">. I</span>f <span style="color:rgb(53,56,51);font-family:&#39;DejaVu Sans Mono&#39;,monospace;font-size:14px;line-height:19.6px">mayInterruptIfRunning </span>is true and the task is already running it will try to interrupt the thread processing it.  This is what this email trail is about.  We all know that java interruption can be flaky to begin with and then adding a remote aspect to it, it becomes even more unreliable.</div><div><br></div><div>So do you guys think we need to support &quot;interrupting&quot; a task in progress?</div><div><br></div><div> - Will</div><div><font color="#353833" face="DejaVu Sans Mono, monospace"><span style="font-size:14px;line-height:19.6px"><br></span></font><div class="gmail_quote"><div dir="ltr">On Wed, Mar 30, 2016 at 12:29 PM Tristan Tarrant &lt;<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I agree with Sanne, we need cancellable  tasks.<br>
<br>
Tristan<br>
<br>
On 30/03/2016 18:19, Sanne Grinovero wrote:<br>
&gt; The term &quot;Interruption&quot; might have been too specific, but being able<br>
&gt; to cancel a task seems essential to me.<br>
&gt;<br>
&gt; On 30 March 2016 at 17:04, William Burns &lt;<a href="mailto:mudokonman@gmail.com" target="_blank">mudokonman@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Recently we have been moving a lot of our methods that return Future [1] to<br>
&gt;&gt; CompletableFuture [2].  Unfortunately the latter, CompletableFuture, doesn&#39;t<br>
&gt;&gt; allow for cancellation of the future, since there is no thread tied to it.<br>
&gt;&gt; So I am proposing that our DistributedExecutorService [3] no longer allows<br>
&gt;&gt; for interruption of remote threads on a cancellation.  This way we can have<br>
&gt;&gt; our distributed executor service return CompletableFuture instances which do<br>
&gt;&gt; not support interruption.<br>
&gt;&gt;<br>
&gt;&gt; Also to note that DistributedExecutorService extends ExecutorService which<br>
&gt;&gt; returns a normal Future which is documented as allowing cancellation.  In<br>
&gt;&gt; this case I would just document on DistributedExecutorService that we don&#39;t<br>
&gt;&gt; support interruption anyways.<br>
&gt;&gt;<br>
&gt;&gt; Does anyone require the use of interruptable tasks with Distributed<br>
&gt;&gt; Executor?<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt;<br>
&gt;&gt;   - Will<br>
&gt;&gt;<br>
&gt;&gt; [1]<br>
&gt;&gt; <a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html" rel="noreferrer" target="_blank">https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html</a><br>
&gt;&gt; [2]<br>
&gt;&gt; <a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html" rel="noreferrer" target="_blank">https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html</a><br>
&gt;&gt; [3]<br>
&gt;&gt; <a href="https://docs.jboss.org/infinispan/8.1/apidocs/org/infinispan/distexec/DistributedExecutorService.html" rel="noreferrer" target="_blank">https://docs.jboss.org/infinispan/8.1/apidocs/org/infinispan/distexec/DistributedExecutorService.html</a><br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
<br>
--<br>
Tristan Tarrant<br>
Infinispan Lead<br>
JBoss, a division of Red Hat<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</blockquote></div></div></div></div>