Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Client threads - can they be daemon threads?

Hi,

On Wed, Jun 14, 2023 at 4:10 PM Shawn Heisey <eclipse@xxxxxxxxxxxx> wrote:
>
> A little background:
>
> The older clients in SolrJ use the Apache HttpClient, version 4.5.x.
>
> The newer clients in SolrJ use the Jetty HttpClient, currently version
> 10.0.13.
>
> If I use the older client, I can exit the program without closing the
> SolrClient.
>
> If I try this with the newer client, the program never exits, because of
> threads started by the Jetty client.
>
> I am reasonably certain that the Apache client probably also creates
> threads, but if that is the case, I believe those threads are marked as
> Daemon threads so they do not interfere with the JVM shutting down.
>
> Would a request to have the Jetty client's threads marked as daemon be
> taken seriously?  Would I create that feature request on github?

It is already available:

QueuedThreadPool threadPool = new QueuedThreadPool(...);
threadPool.setDaemon(true);

HttpClient httpClient = new HttpClient();
httpClient.setExecutor(threadPool);
httpClient.start();

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top