Bug 150954 - [usability] Remote Monitor makes the System View unusable
Summary: [usability] Remote Monitor makes the System View unusable
Status: REOPENED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
: 161431 (view as bug list)
Depends on: 173042
Blocks:
  Show dependency tree
 
Reported: 2006-07-18 10:29 EDT by Martin Oberhuber CLA
Modified: 2010-05-27 09:26 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2006-07-18 10:29:19 EDT
Set Preferences > Remote Systems > Use Deferred Queries = true.

When the Remote Monitor is used to poll a very slow system,
and refresh rate is set to 5 seconds,
refresh jobs are scheduled very frequently.

While a remote monitor's refresh job is running, the RSE Tree only shows "Pending..." so the view elements are not usable. As soon as the result of the query gets visible, "Pending..." is shown again.

The Remote Monitor should leave the old view contents intact until its new results are available from the remote system. Only then, the old data should be replaced with the new one.
Comment 1 Martin Oberhuber CLA 2006-09-25 10:17:12 EDT
Dave can you check if this is fixed by 1.0M5?
Comment 2 David McKnight CLA 2006-11-15 14:31:16 EST
The monitor view is driven by SystemDeferredTableTreeContentManager which extends DeferredTreeContentManager.   DeferredTreeContentManager is responsible for creating the "Pending..." item and then collecting results to show in the view.  I'm not sure if we should be interfering with that standard Eclipse behaviour.
Comment 3 David McKnight CLA 2006-11-28 15:13:40 EST
Any thoughts about this?
Comment 4 David McKnight CLA 2006-11-30 15:11:44 EST
Looking ata the view here again and I really don't see any problems.  I'm going to mark it as fixed - feel free to reopen if you still see a problem.
Comment 5 David Dykstal CLA 2006-12-13 13:52:18 EST
The problem is in the interaction of the two views. The monitor is causing an automatic refresh of the Systems View at the point of the monitor. If I monitor the actual host (instead of a folder) the "pending..." appears and the whole tree collapses back to its first level. This makes it very difficult to navigate the tree while a monitor is running since the tree is constantly being refreshed.

Both the monitor and the system view are driven from the same model so it may not be possible to dissociate the monitor from the view without some work. I believe folks would see the automatic refresh of the tree when the monitor refreshes as unnatural. Would it be possible or make sense to refresh a copy of a section of the model in the viewer - or perhaps use a filter as a root object that is not visible in the tree?

Reopening - I recommend that this be deferred for some continuing discussion on how monitors should work.
Comment 6 Martin Oberhuber CLA 2006-12-14 07:38:06 EST
Agree -> setting target milestone 2.0

My personal feeling is that the refresh queries from the remote monitor should not show a "pending..." message while they are ongoing. Once the data has arrived from the query, the model (and tree) should be updated without destroying existing selection.
Comment 7 David McKnight CLA 2007-01-04 14:39:23 EST
One thing that could simplify this problem a bit would be to turn the Remote Monitor back into a table rather than a table-tree.  For the most part the value of this view lies in it's use as table, however others may see the tree aspect of this as an important (albeit problematic) bonus.  Any thoughts on that?
Comment 8 David McKnight CLA 2007-02-16 11:41:48 EST
I've changed the monitor back from a table-tree to a table since the value of this view is mostly in it's table capabilities.  Although this doesn't probably doesn't address the SystemView issue described, it does reduce some of the complexity issues of the monitor.
Comment 9 David McKnight CLA 2007-02-23 11:03:37 EST
moving to m6 to look at later
Comment 10 Martin Oberhuber CLA 2007-04-05 04:23:41 EDT
deferring to m7 since it does not seem API is affected
Comment 11 Martin Oberhuber CLA 2007-05-15 16:37:38 EDT
*** Bug 161431 has been marked as a duplicate of this bug. ***
Comment 12 Martin Oberhuber CLA 2007-05-15 16:40:32 EDT
There is little we can do in the RSE framework to fix this, as long as the client subsystems use deferred jobs and the DeferredTreeContentManager. Deferring to after 2.0.

The DeferredTreeContentManager is responsible for collapsing tree nodes in
order to refresh them. While this is done, the tree node is unusable. The problem might be alleviated slightly when the REFRESH events do a better job maintaining the current selection and expand state, as discussed on bug #173042.

Clients can work around this as follows:
1. Have an ISystemViewElementAdapter with supportsDeferredQueries==false
2. Have ISystemViewElementAdapter#getChildren() always return local (cached)
   model objects
3. Listen to ISystemResourceChangeEvents.REFRESH* events
   3a. When a refresh event is received, perform an asynchronous retrieval of
       data from the remote side, with a callback
   3b. When the callback is received, update the local (cached) model and 
       send a REFRESH event that is a subclass of the normal refresh event
   3c. Have step (3a) distinguish the special local refresh event from the
       RSE one, and do not perform the asynchrous retrieval in this case.

In other words, the client doesn't use the RSE deferred query / job mechanism
but rather performs asynchrouns remote queries itself.
Comment 13 Martin Oberhuber CLA 2007-05-15 17:50:18 EDT
Actually, hacking this up might work as follows:

* In SystemView.getContextObject(TreeItem), extend the IContextObject to also
  contain the TreeItem referring to the requested parent.

* In SystemDeferredTreeContentManager.getChildren() get the TreeItem out of
  the IContextObject in order to get the currently displayed children. 
  Instead of just returning the pendingAdapter, return an array of 
  pendingAdapter AND the existing children, and remember the list of existing
  children.

* At the callback when the deferred getter job returns, Perform a refresh 
  of the remembered old list of children against the new list of children;
  removing, adding, updating properties where needed. The absoluteName may
  be needed to do this properly. Also, for those TreeItem children that
  were expanded at the time of refresh, another deferred job needs to be 
  started now. Finally, when all previously expanded members are returned,
  apply the selection that was remembered at the very beginning.

Basically, this idea applies a similar algorithm as was in place in the SystemView at the time when no deferred queries were supported. Note that with the Local files subsystem, the case of non-deferred-queries can still be tried out: it retains selection and expand state in many more cases.

Anyways, I'm not pushing this fix forward any more, since at Wind River we're using the async query method described in comment #12 so it's not so much of an issue for us. A fix for this might be considered for 2.0.1.