<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'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:'DejaVu Sans Mono',monospace;font-size:14px;line-height:19.6px">mayInterruptIfRunning </span>boolean<span style="color:rgb(53,56,51);font-family:'DejaVu Sans Mono',monospace;font-size:14px;line-height:19.6px">. I</span>f <span style="color:rgb(53,56,51);font-family:'DejaVu Sans Mono',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 "interrupting" 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 <<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a>> 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>
> The term "Interruption" might have been too specific, but being able<br>
> to cancel a task seems essential to me.<br>
><br>
> On 30 March 2016 at 17:04, William Burns <<a href="mailto:mudokonman@gmail.com" target="_blank">mudokonman@gmail.com</a>> wrote:<br>
>> Recently we have been moving a lot of our methods that return Future [1] to<br>
>> CompletableFuture [2]. Unfortunately the latter, CompletableFuture, doesn't<br>
>> allow for cancellation of the future, since there is no thread tied to it.<br>
>> So I am proposing that our DistributedExecutorService [3] no longer allows<br>
>> for interruption of remote threads on a cancellation. This way we can have<br>
>> our distributed executor service return CompletableFuture instances which do<br>
>> not support interruption.<br>
>><br>
>> Also to note that DistributedExecutorService extends ExecutorService which<br>
>> returns a normal Future which is documented as allowing cancellation. In<br>
>> this case I would just document on DistributedExecutorService that we don't<br>
>> support interruption anyways.<br>
>><br>
>> Does anyone require the use of interruptable tasks with Distributed<br>
>> Executor?<br>
>><br>
>> Thanks,<br>
>><br>
>> - Will<br>
>><br>
>> [1]<br>
>> <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>
>> [2]<br>
>> <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>
>> [3]<br>
>> <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>
>><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>
> _______________________________________________<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>
><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>