Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 208920 - [commands] The service cache should cache MI command errors as well
Summary: [commands] The service cache should cache MI command errors as well
Status: CLOSED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 0 DD 1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: DD 1.0   Edit
Assignee: Pawel Piech CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 187863
  Show dependency tree
 
Reported: 2007-11-06 13:21 EST by Marc Khouzam CLA
Modified: 2014-01-29 20:34 EST (History)
2 users (show)

See Also:


Attachments
Fix of error message in RequestMonitor (1.33 KB, patch)
2007-11-07 11:47 EST, Marc Khouzam CLA
cdtdoug: iplog-
Details | Diff
Caching of Status, in Services (9.88 KB, patch)
2007-11-09 14:07 EST, Marc Khouzam CLA
no flags Details | Diff
Updated patch with refactoring of contexts (9.97 KB, patch)
2007-11-21 13:34 EST, Marc Khouzam CLA
cdtdoug: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2007-11-06 13:21:50 EST
The cache of the MI services should not only cache the result of successful commands but errors as well.  This would avoid re-sending commands that will fail to the back end.

For example, if the ExpressionService requests the back end to create an invalid expression, we should not re-send this command a second time, even if the views request it; instead, we should use the cache to know what the failure result will be.
Comment 1 Marc Khouzam CLA 2007-11-07 11:47:29 EST
Created attachment 82340 [details]
Fix of error message in RequestMonitor
Comment 2 Marc Khouzam CLA 2007-11-07 11:48:07 EST
Since this tries to improve error handling, I would like to make a related suggestion.

I noticed that the RequestMonitor class, uses the Status.toString() method to set the message of the parent status.  This is the reason why the Exprssion View shows a very long error when trying to evaluate an invalid variable.
I think the RequestMonitor should use Status.getMessage() instead of toString()
This can be seen in the attach patch.

However, this may affect the message stored for a MultiStatus.  Basically, when merging a Status into a MultiStatus, the messages are not merged.
I'm not sure if this is a problem for DSF.

I am not comfortable with the potential impacts of such a change, so I really would like Pawel's and/or Randy's opinion.

Thanks
Comment 3 Pawel Piech CLA 2007-11-07 13:01:00 EST
Hi Marc,
I agree with you, I created bug 209066 for this problem.
Comment 4 Marc Khouzam CLA 2007-11-09 14:07:05 EST
Created attachment 82557 [details]
Caching of Status, in Services

In MICommandCache, instead of caching only a successful result, we cache both the result and the status.  That way, failed commands can also be cached.

As a side-effect, the patch also fixes what I think was a bug, where a failed coalesced command would be cached as if it were successful.

I will wait for approval before checking this in.
Comment 5 Marc Khouzam CLA 2007-11-21 13:34:00 EST
Created attachment 83457 [details]
Updated patch with refactoring of contexts

I redid the patch with the latest code from the context refactoring.
Can I commit it?
Comment 6 Pawel Piech CLA 2007-11-21 13:47:21 EST
Looks good to me, go for it.
Comment 7 Marc Khouzam CLA 2007-11-21 13:49:28 EST
committed
Comment 8 Pawel Piech CLA 2007-11-21 13:56:23 EST
Changes reviewed.
Comment 9 Pawel Piech CLA 2008-08-13 13:05:01 EDT
Closing out 1.0 bugs.