<div dir="auto">"Any logging in the task" is doable if you own the code for it.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 14 May 2023, 06:34 Alan Bateman, <<a href="mailto:Alan.Bateman@oracle.com">Alan.Bateman@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 13/05/2023 23:24, Attila Kelemen wrote:<br>
> Also, another issue is that, if I shutdown the STS, then every<br>
> exception happening will be silently discarded with no means to see<br>
> them. Even though the action can have bugs in case of shutdown. For<br>
> example, it can run into an NPE or whatever in a mismanaged cleanup.<br>
><br>
The current spec is that handleComplete is not invoked after the scope <br>
has been shutdown. Calling shutdown means you've got the outcome, <br>
interrupt the unfinished tasks as you don't care about them. Aside from <br>
logging, what would your code do?  The equivalent with Executors and <br>
Future.cancel is Future::get throwing CancellationException - any <br>
logging needs to be in the task.<br>
<br>
-Alan.<br>
</blockquote></div>