[jbosstools-dev] [JBIDE-14405] WaitJob not safe, thought I'd ping you

Rob Stryker rstryker at redhat.com
Thu May 9 05:51:15 EDT 2013


Hey All:

When browsing code, I found something very interesting and dangerous.

The wait job inside ECFTransport is not a safe implementation. It seems 
there's an upstream eclipse issue on join() which was a workaround for 
UI deadlocks but makes a join() not able to be interrupted.

You can read more on the eclipse bug: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=293312

Any time your code uses Join, you should pay extra attention as to who 
can interrupt you, for what reason, or not.  If join() is not able to be 
interrupted, and the job you join against freezes, both threads may be 
deadlocked forever. Stopping the job will NOT un-lock your job OR the 
joined thread, either, unless your job overrides the canceling() method 
to interrupt itself!

So be aware.

My new implementation of WaitJob is here below:

https://github.com/jbosstools/jbosstools-base/blob/master/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/core/ecf/internal/WaitJob.java 



More information about the jbosstools-dev mailing list