Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352437 - [Display] syncExec() does not return if display is disposed of
Summary: [Display] syncExec() does not return if display is disposed of
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: sr141
Keywords:
: 328347 354700 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-19 06:56 EDT by Wolfgang Pedot CLA
Modified: 2012-09-12 05:03 EDT (History)
3 users (show)

See Also:


Attachments
Test case that demonstrates the bug (1.14 KB, patch)
2011-07-19 13:20 EDT, Rüdiger Herrmann CLA
no flags Details | Diff
Refined test and solution proposal (2.43 KB, patch)
2011-07-19 17:12 EDT, Rüdiger Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Pedot CLA 2011-07-19 06:56:28 EDT
Build Identifier: 1.4.0.20110614-2335

If there is a syncExec-call from a background-thread when there is no more browser-side available (User closed browser or network is down) that call does not return when the HTTP-Session times out and the display gets closed.

After those events the background-thread is still locked in its syncExec-call because it waits in Synchronizer.syncExec for the RunnableLock to be marked as "done". Even interrupting the thread does not help because that exception is caught inside and there is a while(!done) loop arround the try-catch block.

I would propose to not just nullify messages in Synchronizer.releaseSynchronizer but to iterate through them, mark them all as done and notify the threads to make sure the syncExec-Calls return.

The problem does of not happen if we use asyncExec but we were having sporadic deadlocks with that in 1.3 (see bug 351269). Now we are leaking lots of threads instead so we will probably go back to asyncExec for now and check out if 1.4 fixed bug 351269.

Reproducible: Always

Steps to Reproduce:
1.) Worbench is open, UICallback is enabled, background-activities trigger syncExec from time to time, everthing is fine
2.) the user just closes the browser or the network-connection goes down
3.) another syncExec-call happens but does not return because there is no browser-side any more
4.) session timeout happens, the display gets closed but the syncExec call does not return
Comment 1 Rüdiger Herrmann CLA 2011-07-19 13:20:22 EDT
Created attachment 199921 [details]
Test case that demonstrates the bug
Comment 2 Rüdiger Herrmann CLA 2011-07-19 17:12:52 EDT
Created attachment 199948 [details]
Refined test and solution proposal

In Synchronizer#releaseSynchronizer(), all RunnableLocks of sync-runnables are manipulated so that their done() method will return true and then notified.
This causes the execution to continue in syncExec(). The runnable itself will not be executed.
Comment 3 Rüdiger Herrmann CLA 2011-07-20 10:39:48 EDT
Committed patch to CVS HEAD
Comment 4 Ivan Furnadjiev CLA 2011-07-26 03:37:00 EDT
Applied patch to v14_Maintenance with a replacement of missing AtomicBoolean in Java 1.4 in Display_Test.
Comment 5 Ivan Furnadjiev CLA 2011-08-22 02:40:18 EDT
*** Bug 354700 has been marked as a duplicate of this bug. ***
Comment 6 Tim Buschtoens CLA 2011-08-25 09:36:19 EDT
Fixed in v14_Tree_Table_Merge branch. (Code copied from v14_Maintenance branch)
Comment 7 Ralf Sternberg CLA 2012-09-12 05:03:04 EDT
*** Bug 328347 has been marked as a duplicate of this bug. ***