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

Bug 280363

Summary: DecorationScheduler Job never finishes
Product: [RT] RAP Reporter: Ian Bull <irbull>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 1.1   
Target Milestone: 1.3 M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch to reproduce
none
Proposed fix none

Description Ian Bull CLA 2009-06-15 19:25:31 EDT
There appears to be an infinite loop in RAP when a decoration job is running.  If you have a decoration job running, and you close your connection (shudown the browser), the decoration job runs forever.  (and hangs on to UI Thread object too).

If you look at DecorationScheduler#createDecorationJob:

while (updatesPending()) {
  System.out.println("Update Pending:");
  try {
    Thread.sleep(100);
  } catch (InterruptedException e) {
    // Cancel and try again if there was an error
    // RAP [rh] fake service context
    UICallBack.runNonUIThreadWithFakeContext( display, new Runnable() {
      public void run() {
        decorationJob.schedule();
      }
    });
  return Status.CANCEL_STATUS;
 }
}

This just keeps sleeping, and updatePending returns true.

I reproduced this by added a decorator to the RAP Mail demo (to the navigator view).  I then printed 1000 names in the view, and expanded the tree.  While waiting for the tree to expand I closed the browser, and observed that we sit in an infinite loop.
Comment 1 Benjamin Muskalla CLA 2009-09-15 05:46:50 EDT
Created attachment 147179 [details]
patch to reproduce

Small patch for demo workbench to reproduce, just collapse the tree.
Comment 2 Rüdiger Herrmann CLA 2009-09-16 12:00:11 EDT
Created attachment 147336 [details]
Proposed fix
Comment 3 Rüdiger Herrmann CLA 2009-09-17 07:42:13 EDT
Committed patch to CVS HEAD.
The fix was to call DecoratorManageräshutdown when the session is invalidated. In addition DecorationScheduler#updatePending() now returns false if shutdown was requested.