<div dir="ltr"><div>I made the assumption that they were no-op because they were likely shared thread-pools where as using it like an API each extension that uses it has it's own thread-pool.</div><div><br></div>A stop would work for the shutdown, but you'd really need to use the shutdownNow() if the timeout has been reached. A ThreadPoolExecutor by default won't interrupt running threads during a shutdown. Though it does make sense that the service should be the one that handles it. Maybe each stop() should do something like;<div><br></div><div>shutdown();</div><div>awaitTermination();</div><div>shutdownNow();</div><div><br></div><div>I do think them being services makes sense. For example in batch-jberet a thread-pool is exposed as a capability. That's another thing on my todo list for thread-pools, but out of scope of this :)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 15, 2015 at 11:10 AM, Brian Stansberry <span dir="ltr"><<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I haven't really thought about this and it's quite possible changing<br>
this stuff is the right thing to do. So just take the following as being<br>
about clarification and not opposition:<br>
<br>
I don't understand the significance of having the thread subsystem or not.<br>
<br>
IIRC these services don't expose those methods because the Service<br>
stop() method is meant to control the pool lifecycle. So if these are<br>
still MSC services, that reasoning still applies. (Note: it may have<br>
been bad reasoning.)<br>
<br>
Also, these are still used in much the same fashion as they were before<br>
when we used the threads subsystem. The use has just been inlined into<br>
other subsystems.<br>
<div><div class="h5"><br>
On 12/15/15 12:13 PM, James Perkins wrote:<br>
> Hello All,<br>
> The thread-pool utilities don't currently allow the shutdown() or<br>
> shutdownNow() [1] to be executed on the delegate executor. This made<br>
> sense when we had a thread subsystem, but now that we don't it makes<br>
> these executors hard to use for things like graceful shutdown. For<br>
> example if a graceful shutdown limit has been reached threads submitted<br>
> from these thread-pools continue running as there's no way to shut them<br>
> down and kill running threads.<br>
><br>
> I'd propose that since these are utilities now that these methods be<br>
> exposed for usage [2]. Does anyone see an issue with that? Or have<br>
> alternative ides?<br>
><br>
><br>
> [1]<br>
> :<a href="https://github.com/wildfly/wildfly-core/blob/69fed63548cbebed86e31ba376f0f7f147fe04a2/threads/src/main/java/org/jboss/as/threads/ManagedExecutorService.java#L71-L84" rel="noreferrer" target="_blank">https://github.com/wildfly/wildfly-core/blob/69fed63548cbebed86e31ba376f0f7f147fe04a2/threads/src/main/java/org/jboss/as/threads/ManagedExecutorService.java#L71-L84</a><br>
> [2]:<br>
> <a href="https://github.com/wildfly/wildfly-core/compare/master...jamezp:thread-pool-shutdown" rel="noreferrer" target="_blank">https://github.com/wildfly/wildfly-core/compare/master...jamezp:thread-pool-shutdown</a><br>
><br>
> --<br>
> James R. Perkins<br>
> JBoss by Red Hat<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> wildfly-dev mailing list<br>
> <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Brian Stansberry<br>
Senior Principal Software Engineer<br>
JBoss by Red Hat<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>James R. Perkins</div><div>JBoss by Red Hat</div></div></div></div></div>
</div>