[RFC] PAV: add missing panel timeout check
Thomas Meyer
thomas at m3y3r.de
Sun Jan 22 03:00:58 PST 2012
# HG changeset patch
# User thomas
# Date 1327229831 -3600
# Node ID ddb05011ff2f86ccdd2d0bad1fa659941fda66f1
# Parent 7d090bfa381924100c0f8446dda2a615a75637d9
The wait loop for the panel to instantiate will result in a really *long* wait loop, e.g. when the JAR for the panel class is not found for some reason, as each loop step will wait 180s.
while waiting for the loop to finish, at least the firefox browser becomes unresponsive for all open tabs.
i'm not sure why this happens, but I guess the c++ side waits for a response it never gets and this will stall the whole browser.
maybe we should decrease the maximum wait timeout to something more appropriate?!
diff -r 7d090bfa3819 -r ddb05011ff2f plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Tue Dec 13 12:45:36 2011 +0100
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Sun Jan 22 11:57:11 2012 +0100
@@ -745,9 +745,17 @@
long maxTimeToSleep = APPLET_TIMEOUT;
panelLock.lock();
try {
- while (panel == null || !panel.isAlive())
+ while (panel == null || !panel.isAlive()) {
maxTimeToSleep -= waitTillTimeout(panelLock, panelLive,
maxTimeToSleep);
+
+ // we already waited till timeout, give up here directly, instead of waiting 180s again in below waitForAppletInit()
+ if(maxTimeToSleep < 0) {
+ panelLock.unlock();
+ streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization timed out");
+ return;
+ }
+ }
}
finally {
panelLock.unlock();
More information about the distro-pkg-dev
mailing list