I&#39;m not sure using Thread.interrupt() will work that well for cancelling arbitrary distributed tasks without the Cache methods also throwing InterruptedException. If we catch InterruptedExceptions and wrap them in CacheExceptions, the distributed task won&#39;t know that it has been cancelled.<br>
<br>It may retry whatever cache operation it was doing (e.g. if using optimistic txs), and it will succeed, because the interrupted flag on the thread has been cleared when the InterruptedException was thrown. It would be possible to extract the cause of caught CacheExceptions and check the inner exception type, but that would be easy to overlook.<br>
<br>Cheers<br>Dan<br><br><br><div class="gmail_quote">On Mon, Sep 24, 2012 at 1:46 PM, Manik Surtani <span dir="ltr">&lt;<a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br><div><div><div class="h5"><div>On 24 Sep 2012, at 11:39, Vladimir Blagojevic &lt;<a href="mailto:vblagoje@redhat.com" target="_blank">vblagoje@redhat.com</a>&gt; wrote:</div><br><blockquote type="cite">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>On 12-09-21 2:34 PM, Manik Surtani
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      Looks good, except that the pseudocode for dealing with a
      CancellableCommand (on the recipient node) should look like:
      <div><br>
      </div>
      <div>* Receive command</div>
      <div>* if CancellableCommand, register with CancellationService</div>
      <div>* Perform command</div>
      <div>* If CancellableCommand, un-register from CancellationService</div>
      <div><br>
      </div>
      <div>That last step was missing from your detail below.  I presume
        that would require a CancellationService#unregisterThread(UUID
        u) ?</div>
      <br>
    </blockquote>
    I was looking at the most appropriate place for this logic and I
    think InboundInvocationHandlerImpl#handleInternal method and its
    try/catch/finally clause fits the bill, would you agree?<br></div></blockquote><div><br></div></div></div><div>I believe so, yes.</div><div><br></div></div><div class="im"><div>
<span style="border-spacing:0px;text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-spacing:0px;text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-spacing:0px;text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a></div><div><a href="http://twitter.com/maniksurtani" target="_blank">twitter.com/maniksurtani</a></div><div><br>
</div><div><div>Platform Architect, JBoss Data Grid</div><div><a href="http://red.ht/data-grid" target="_blank">http://red.ht/data-grid</a></div></div></div></span></div></span></div></span>
</div>
<br></div></div><br>_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br></blockquote></div><br>