Bug 308824 - [concurrency] RequestMonitor should preserve exact success status when propagating success
Summary: [concurrency] RequestMonitor should preserve exact success status when propag...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 6.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-12 09:16 EDT by Marc Khouzam CLA
Modified: 2020-09-04 15:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2010-04-12 09:16:11 EDT
I thought it would be nice to be able to set a little more information in a successful requestMonitor.  To do that, I was going to use the status, and use a message or a code.

The problem is that successful request monitors do not preserve the status when it is successful, so any special content is lost.

It is easy enough to replace in RequestMonitor.java

    protected void handleSuccess() {
        if (fParentRequestMonitor != null) {
            fParentRequestMonitor.done();
        }
    }

with

    protected void handleSuccess() {
        if (fParentRequestMonitor != null) {
            fParentRequestMonitor.setStatus(getStatus());
            fParentRequestMonitor.done();
        }
    }

The problem is that we overide handleSuccess() and handleCompleted() all over the place, and those also don't preserve the status().  

We wouldn't have to change anything actually, but if anyone wanted to use special content in a successful RM, they would have to make sure they chain of RMs did preserve the status().

This is kind of a enhancement in the DSF programming style...  So I'm not sure it is something we should do.
Comment 1 Pawel Piech CLA 2010-04-12 11:52:03 EDT
Interesting, I never thought of this use case before.  I agree that if we're going to try to fix this bug we should go through all the places in open source where handleSuccess/handleCompleted are overridden and fix them.  

Another complication may be that if there are multiple async operations being performed for a single client operation.  Then the OK statuses would need to be merged into a single status in the parent RM.  Where as in case of an error, the first error encountered is usually reported directly to the client and no merging of statuses is needed.
Comment 2 Marc Khouzam CLA 2010-04-12 15:08:07 EDT
(In reply to comment #1)
> Interesting, I never thought of this use case before.  I agree that if we're
> going to try to fix this bug we should go through all the places in open source
> where handleSuccess/handleCompleted are overridden and fix them.  
> 
> Another complication may be that if there are multiple async operations being
> performed for a single client operation.  Then the OK statuses would need to be
> merged into a single status in the parent RM.

Right, I had not thought of that.

Well, I worked around this 'limitation' :-) So I don't really need it anymore.  I think it would be nice, but there is no way I'm going through all the code to fix the overridden handleSuccess/handleCompleted :-)

Let's leave it as an exercise to the reader.