[icedtea-web] RFC: Patch to fix applet exit

Denis Lila dlila at redhat.com
Mon May 2 11:24:18 PDT 2011


> Yep, I thought about that case but the probability of that is very
> low.
> Between having the VM potentially shut down before an applet starts
> (fixable by refreshing) and having a running applet freeze (which
> could
> include unsaved work), the former sounds like the lesser of 2
> evils and more acceptable in the short term.
> 
> Omair's original comment about having a separate ThreadGroup is the
> correct approach, but is not easy to implement atm, especially within
> the 1.1 time frame.
> 
> One thing we can do is add this to 1.1 only, but I really don't think
> the case of "VM shut down when another applet is starting" is worth
> worrying about for now, given how unlikely it is.

I see.
I assume this will be easier to fix after the security redesign, right?
In any case, what you say makes sense, and it's true that all you have
to do to make the applet work is to refresh the page, I say this is good to
go for head and 1.1 (but maybe put a TODO in there? We should fix this
eventually after all.).

Regards,
Denis.

----- Original Message -----
> * Denis Lila <dlila at redhat.com> [2011-05-02 13:47]:
> > > This patch addresses an issue cause by the tg.stop() call in
> > > PluginAppletViewer.appletClose().
> > >
> > > With the recent classloader sharing changes, applets from the same
> > > page
> > > have the same threadgroup. As a result if 2 copies are opened and
> > > one
> > > is
> > > closed, the other one stops too.
> > >
> > > With this patch, tg.stop() is no longer called and instead, the
> > > plugin
> > > will halt the VM after the last applet to guarantee that resources
> > > are
> > > freed eventually (the tg.stop was added because not all applets
> > > exit
> > > nicely on stop/dispose).
> >
> > Is it possible for an applet creation to be racing with the
> > applet close? I'm thinking, what happens if we're handling an
> > applet creation but we haven't called the PAV constructor yet?
> > (so, suppose we're still in parse() and haven't called
> > factory.createPanel yet).
> >
> > In that case, wouldn't we just shut down the vm, because
> > we haven't added the PAV to appletPanels yet and so
> > 0==countApplets()? Isn't this wrong?
> >
> 

> 
> Cheers,
> Deepak
> 
> > Regards,
> > Denis.
> >
> > ----- Original Message -----
> > > Hi,
> > >
> >
> > > ChangeLog:
> > > 2011-05-02 Deepak Bhole <dbhole at redhat.com>
> > >
> > > * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
> > > (appletClose): Do not try to stop threads, now that the loader is
> > > shared
> > > and the thread group for applets on a page is identical. Call
> > > dispose
> > > from
> > > invokeAndWait.
> > > (appletSystemExit): Exit the VM when called.
> > >
> > > Okay for HEAD and 1.1?
> > >
> > > Cheers,
> > > Deepak



More information about the distro-pkg-dev mailing list