Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 309244 - Job Submission Error not displayed in error dialog
Summary: Job Submission Error not displayed in error dialog
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Launch (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Albert L. Rossi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 18:57 EDT by Albert L. Rossi CLA
Modified: 2010-05-31 19:15 EDT (History)
1 user (show)

See Also:


Attachments
patch with the fix described (2.02 KB, application/octet-stream)
2010-04-14 18:57 EDT, Albert L. Rossi CLA
g.watson: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albert L. Rossi CLA 2010-04-14 18:57:01 EDT
Created attachment 164921 [details]
patch with the fix described

An IResourceManagerSubmitJobErrorEvent currently is not diplayed in an error dialog by the AbstractParallelLaunchConfigurationDelegate.  

The reason for this is that the state handling has an incorrect condition which creates a race condition between the "waitFor()" method of the JobSubmission class and the "submit()" method.  The error is at line 235 of the AbstractParallelLaunchConfigurationDelegate.java file:

while (!monitor.isCanceled() && status != JobSubStatus.SUBMITTED) {

Since the submission is initialized to this state, only in the event that an ERROR or COMPLETED event is processed by the ResourceManagerListener before the return of the waitFor() method will the code behave properly.  In most cases, however, these events arrive after that method has returned.

Line 235 should be:

while (!monitor.isCanceled() && status == JobSubStatus.SUBMITTED)

SUMBITTED here really means "not yet submitted", with the COMPLETED state representing SUBMITTED.  For the sake of clarity, the enumeration at line 123 has also been changed to:

public enum JobSubStatus {UNSUBMITTED, SUBMITTED, ERROR}.
Comment 1 Greg Watson CLA 2010-04-15 15:16:00 EDT
Al, please confirm that:

1) This code contains no cryptography.

2) The code has been developed from scratch (i.e. without incorporating content
from elsewhere or relying on the intellectual property of others).

3) All code in the contribution is licensed under the EPL.
Comment 2 Albert L. Rossi CLA 2010-04-20 23:13:05 EDT
(In reply to comment #1)
> Al, please confirm that:
> 
> 1) This code contains no cryptography.
> 
> 2) The code has been developed from scratch (i.e. without incorporating content
> from elsewhere or relying on the intellectual property of others).
> 
> 3) All code in the contribution is licensed under the EPL.

I, Albert L. Rossi, confirm that:
1) This code contains no cryptography.
2) The code has been developed from scratch (i.e. without incorporating content from elsewhere or relying on the intellectual property of others).
3) All code in the contribution is licensed under the EPL.
Comment 3 Greg Watson CLA 2010-04-21 13:43:33 EDT
I think I can see the declaration. Al, you need to fix how you add comments in bugzilla, it looks like newlines are getting escaped somewhere.

Committed to HEAD.