Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 51996

Summary: Blocked UI warning occurs multiple times simultaneously
Product: [Eclipse Project] Platform Reporter: Kim Horne <eclipse>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Darin_Swanson, john.arthorne, n.a.edgar, pascal, philippe_mulet, snorthov, Tod_Creasey
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
BAM!
none
Patch to org.eclipse.ui.workbench none

Description Kim Horne CLA 2004-02-13 15:26:38 EST
M7

I was doing a 'replace from head' operation on several projects at once.  When
the operation had been underway for some time I attempted to expand a tree on a
project I was checking out at the time.  When I did, I had 7+ progress info
dialogs open up on me.
Comment 1 Kim Horne CLA 2004-02-13 15:28:06 EST
Created attachment 7901 [details]
BAM!
Comment 2 John Arthorne CLA 2004-02-13 18:08:56 EST
*** Bug 52001 has been marked as a duplicate of this bug. ***
Comment 3 John Arthorne CLA 2004-02-13 18:09:59 EST
If anyone reproduces it, a stack trace would be useful.
Comment 4 Kim Horne CLA 2004-02-27 15:38:22 EST
*** Bug 53315 has been marked as a duplicate of this bug. ***
Comment 5 John Arthorne CLA 2004-03-01 12:19:26 EST
There needs to be a guard in EventLoopProgressMonitor or ProgressManager to
avoid opening a second "blocked" dialog if one is already open, just like
ProgressMonitorDialog and ModalContext maintain a progress depth. I will look
into this.
Comment 6 Michael Valenta CLA 2004-03-11 15:08:08 EST
*** Bug 54522 has been marked as a duplicate of this bug. ***
Comment 7 Tod Creasey CLA 2004-04-05 16:20:51 EDT
*** Bug 57006 has been marked as a duplicate of this bug. ***
Comment 8 John Arthorne CLA 2004-04-12 12:15:26 EDT
*** Bug 57998 has been marked as a duplicate of this bug. ***
Comment 9 John Arthorne CLA 2004-04-26 12:34:04 EDT
*** Bug 59967 has been marked as a duplicate of this bug. ***
Comment 10 John Arthorne CLA 2004-04-28 17:02:37 EDT
Created attachment 10079 [details]
Patch to org.eclipse.ui.workbench

Here is a patch to fix the workbench portion of this problem. The
BlockedJobsDialog now uses a static singleton, so that recursive blockages can
reuse the same dialog. The dialog is only closed when the outermost monitor to
block on it is finished. Recursive monitors can access the dialog's monitor to
check for user cancelation requests.
Comment 11 John Arthorne CLA 2004-04-28 17:10:01 EDT
The core portion of this problem has been fixed and released.  The problem was this:

- Each recursive blockage in the stack queued a job and waited for that job to
be executed
- Since jobs with conflicting rules are processed in FIFO order, the job
corresponding to the bottom-most blockage on the stack was granted execution
first.  Meanwhile, the blockage at the top of the stack is still spinning in a
loop and waiting for its job to execute.  It will never execute, since it is
blocked by the job for the blockage at the bottom of the stack.
- It was usually still possible for the user to cancel out of this deadlock by
dismissing all the blocked dialogs in front of them.

The fix, unfortunately, is to NOT queue a job when threads are blocked, but
rather use a polling loop to attempt to acquire the scheduling rule. This means
queued blockages will not be processed in FIFO order, but instead the rule would
be obtained by the first polling loop to grab the rule. This guarantees that in
the case of recursive blockage, the top-most blockage will get the rule first,
and the stack will eventually unwind. The singleton blocked jobs dialog is only
closed when the stack has unwound completely.

As the core code has already been released, I will move this over to Tod to
release my patch to the workbench.
Comment 12 Tod Creasey CLA 2004-04-29 12:56:08 EDT
Released with some modifications/refactorings to fit the current state of the 
workbench.