United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7076629 LiveConnect call from JavaFX application thread can cause deadlock
7076629 : LiveConnect call from JavaFX application thread can cause deadlock

Details
Type:
Bug
Submit Date:
2011-08-09
Status:
Resolved
Updated Date:
2011-09-22
Project Name:
JDK
Resolved Date:
2011-08-17
Component:
deploy
OS:
generic
Sub-Component:
plugin
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
7-client
Fixed Versions:
7u2

Related Reports
Backport:

Sub Tasks

Description
There are potential to cause deadlock between client JVM and server JVM when messages exchange are implemented as blocking code.

The JavaFX application thread is the native message dispatching thread, when calling LiveConnect to browser VM, the thread is blocked waiting for response.

In case the browser action is depending on JavaFX to handle some native message, such as browser asking for focus, as the message dispatch is stopped, this cause a dead-lock.

A test case can be found at 
http://javaweb.us.oracle.com/~hj156752/testcases/rt15039/FXLiveConnectCallTest.html

Originally reported at
http://javafx-jira.kenai.com/browse/RT-15039

                                    

Comments
SUGGESTED FIX

Introduced Waiter pattern used to waiting for blocking code. Toolkit provider can set Waiter for proper blocking behavior.

http://sa.us.oracle.com/projects/deployment_data/7-client/7076629.3
                                     
2011-08-11
EVALUATION

Message deadlock is the root cause as the problem went away if we timeout on the waiting.
                                     
2011-08-09
SUGGESTED FIX

Make sure the calling thread won't blocked message dispatching. For that, we need to know if the thread is message dispatching thread and allow the thread to continue to dispatch native messages while the operation is blocked.

As it's toolkit specific, we will ask Toolkit to provide an AsyncHarness, a utility interface to implement synchronous behavior in an asynchronous way when the thread should not be blocking.
                                     
2011-08-09



Hardware and Software, Engineered to Work Together