[icedtea-web] not closeable javaws (and maybe more)

Jiri Vanek jvanek at redhat.com
Tue Feb 17 11:30:50 UTC 2015


On 02/17/2015 11:57 AM, Jiri Vanek wrote:
> On 02/17/2015 11:00 AM, Jiri Vanek wrote:
>> Hi!
>>
>> Head, for already some time javaws apps needs to be closed by signal kill. For long time I thought this is soem accident or whatever, but it is not.
>> Today I tracked it to guilty changeset of  http://icedtea.classpath.org/hg/icedtea-web/rev/6f4c1d501560
>>
>> Looking for the fix now, but in case I fail, this will spare some time to the followr,
>>
>>   J.
>
> Ok, so the caus eis clear, ServiceExecutor do not run as daemon, and so is preventing jvm to stop.
>
> I'm wondering Why I dont see this issue from plugin side...
>
> Anyway - for javaws - both ok and failed run - where to place call to
>
> diff -r a8baec8d9d21 netx/net/sourceforge/jnlp/cache/ResourceTracker.java
> --- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java    Fri Feb 13 12:48:24 2015 +0100
> +++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java    Tue Feb 17 11:57:01 2015 +0100
> @@ -34,6 +34,7 @@
>   import java.util.List;
>   import java.util.concurrent.ExecutorService;
>   import java.util.concurrent.Executors;
> +import java.util.concurrent.TimeUnit;
>
>   import net.sourceforge.jnlp.DownloadOptions;
>   import net.sourceforge.jnlp.Version;
> @@ -633,4 +634,15 @@
>       interface Filter<T> {
>           public boolean test(T t);
>       }
> +
> +    public static void shutdDownThreadPool() throws InterruptedException{
> +        threadPool.shutdown();
> +        if (!threadPool.awaitTermination(5, TimeUnit.SECONDS)) {
> +            OutputController.getLogger().log("Executor did not terminate in the specified time.");
> +            List<Runnable> droppedTasks = threadPool.shutdownNow();
> +            OutputController.getLogger().log("Executor was abruptly shut down. " + droppedTasks.size() + " tasks will not be executed.");
> +        }
> +    }
> +
> +
>   }
>
>
> ?

One more thought, attached patch fixed the issue for me:

It does only thing - it changes threads used by ExecutorService to daemons.

Well, I dont know whot Iahve done - I dont know if ExecutorService is still keeping its purpose when its threads are daemons.

On contrary, documentation is silent, and usage of custom ThreadFactory is supported....
As negativism, original code (before patch 6f4c1d501560) was not using daemons. But was not recycling threads...


Thoughts?

J.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixThreads.patch
Type: text/x-patch
Size: 2536 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20150217/49f5f251/fixThreads.patch>


More information about the distro-pkg-dev mailing list