United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7153298 : webstart start 2 background update threads resulted in double downloads of same jars

Details
Type:
Bug
Submit Date:
2012-03-13
Status:
Closed
Updated Date:
2012-04-11
Project Name:
JDK
Resolved Date:
2012-04-11
Component:
deploy
OS:
generic
Sub-Component:
deployment_toolkit
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Backport:

Sub Tasks

Description
- Turn on tracing level all.
- Run webstart an application with applet-desc having <update check='background'/> with lazy jars that would not be downloaded until after the application started.
- Update the lazy jar, make sure to touch it so timestamp change.
- Observe in tracing file double starting of LDUpdater and double downloading of same lazy jar:
network: LDUpdater: started background update check
...
network: LDUpdater: started background update check
...
network: Background Update Thread: update cache: http://javaweb/~ntnguyen/tests/check-always-lazy-update/lib/MyUtil.jar
...
network: Background Update Thread: update cache: http://javaweb/~ntnguyen/tests/check-always-lazy-update/lib/MyUtil.jar
...

                                    

Comments
EVALUATION

LDUpdate threads were created by the following stacks:
1)
	at com.sun.javaws.jnl.LDUpdater.startBackgroundUpdate(LDUpdater.java:340)
	at com.sun.javaws.jnl.LDUpdater.startBackgroundUpdate(LDUpdater.java:336)
	at com.sun.javaws.jnl.LDUpdater.startBackgroundUpdateOpt(LDUpdater.java:270)
	at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:262)
	at com.sun.javaws.Launcher.launch(Launcher.java:169)
	at com.sun.javaws.Main.launchApp(Main.java:529)
	at com.sun.javaws.Main.continueInSecureThread(Main.java:337)
	at com.sun.javaws.Main$1.run(Main.java:189)

2)
	at com.sun.javaws.jnl.LDUpdater.startBackgroundUpdate(LDUpdater.java:340)
	at com.sun.javaws.jnl.LDUpdater.startBackgroundUpdate(LDUpdater.java:336)
	at com.sun.javaws.jnl.LDUpdater.startBackgroundUpdateOpt(LDUpdater.java:270)
	at sun.plugin2.applet.JNLP2Manager.loadJarFiles(JNLP2Manager.java:463)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1563)

We need to make sure LDUpdater remember the "already started" state to skip starting a second background thread.  Also, check other tasks JNLP2Manager might duplicate other tasks already started by webstart Main/Launcher.
                                     
2012-03-13
EVALUATION

Fixed by moving the call the start background update thread down to before executing the application or applet main class.  See:
http://sa.us.oracle.com/mail-archive/7153298-deployment

Fixed in 8 with changeset:
http://closedjdk.us.oracle.com/jdk8/deploy/deploy/rev/8b2f1ad990c4
                                     
2012-03-16



Hardware and Software, Engineered to Work Together