| Summary: | Debug view added to wrong perspective while user prompted to switch perspectives | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Alan Boxall <boxall> | ||||||
| Component: | Debug | Assignee: | Darin Wright <darin.eclipse> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | darin.eclipse, farzi, Michael_Rennie, remy.suen | ||||||
| Version: | 3.6 | ||||||||
| Target Milestone: | 3.7 M3 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Alan Boxall
Created attachment 181187 [details]
patch
The problem is caused by the fact that the perspective switching manager receives two requests to handle a swtich - one from the thread suspend event and the other from the target suspend event. The same problem could happen if two different threads suspended in rapid succession.
This patch ignores subsuquent requests to switch if a switch is already being processed for the same launch. I was not seeing the problem when 2 or more thread suspend events were sent. In my testcase I on purpose left up the perspective switch dialog while my application under debug sent more thread suspend events and I never saw the debug view getting added to the current perspective. Only when a thread suspend AND a target suspend were sent did I see the problem. Not sure that affects your fix strategy but thought I would mention it. NOTE: My debugger always sends 2 thread suspend events at session startup and when I suppressed the target suspend I didn't see the problem. With this sample program I see the wrong behavior with two threads suspending at separate times. Just launch and wait for 4-5 seconds.
public class Two {
class Suspend implements Runnable {
public void run() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
System.out.println("Suspend"); // BREAKPOINT
}
}
public static void main(String[] args) throws InterruptedException {
new Two().go();
}
public void go() throws InterruptedException {
Thread t1 = new Thread(new Suspend());
Thread t2 = new Thread(new Suspend());
t1.start();
Thread.sleep(4000);
t2.start();
t1.join();
t2.join();
}
}
The proposed patch removes the support to run a job after a perspective switch (which was added by bug 87587). I could find no users of this API, but to be safe, I should probably add the support back in. Created attachment 181201 [details]
patch
This patch uses jobs and scheduling rules to handle the perspective switch request serially. It also schedules "post switch" jobs serially.
Released to HEAD (second patch using scheduling rules). Fixed. Verified. Based on the tests from Alan, the problem does not seem to be resolved. Could you please provide some information as to how we can resolve this issue since there is a customer waiting for a resolution of this problem? Thanks, Farzi. (In reply to comment #9) > Based on the tests from Alan, the problem does not seem to be resolved. Which build did you test with? I am sorry Alan verified that this fix is complete but it uncovered another problem in the debug core and he will be opening a bug for it soon. Farzi. |