Bug 297356 - [Progress] Exporting with workspace compiled files logs problems twice
Summary: [Progress] Exporting with workspace compiled files logs problems twice
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Prakash Rangaraj CLA
QA Contact: Prakash Rangaraj CLA
URL:
Whiteboard:
Keywords: polish
Depends on:
Blocks:
 
Reported: 2009-12-09 11:12 EST by Curtis Windatt CLA
Modified: 2010-03-10 00:34 EST (History)
1 user (show)

See Also:


Attachments
Fix to remove double logging (1.25 KB, patch)
2010-02-22 10:16 EST, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2009-12-09 11:12:59 EST
1. New plug-in project using a template (plug-in with a view works)
2. Put some random text or other problem into Activator.java
3. Export > Plug-ins and Fragments
4. Turn on "Use class files compiled from the workspace" option
5. Run the export
Result:
The compile problems are reported in a popup dialog, but they are logged twice in the log.
Comment 1 Curtis Windatt CLA 2009-12-09 11:13:51 EST
This can wait until M5.
Comment 2 Curtis Windatt CLA 2010-01-18 17:44:12 EST
Pushing polish items to M6.
Comment 3 Curtis Windatt CLA 2010-02-10 11:51:59 EST
Moving to Platform Core for comment.  I assume that PDE is doing something incorrectly, but both messages are logged inside the job structure.

When our export job completes it has an error status.  In the finally block of Worker.run() the status gets logged twice.  The first during pool.endJob(currentJob, result) (this also pops up the error dialog).  Immediately after a call to RuntimeLog.log(result) causes the status to be put into the log a second time.
Comment 4 John Arthorne CLA 2010-02-11 14:04:02 EST
(In reply to comment #3)
> When our export job completes it has an error status.  In the finally block of
> Worker.run() the status gets logged twice.  The first during
> pool.endJob(currentJob, result) (this also pops up the error dialog). 
> Immediately after a call to RuntimeLog.log(result) causes the status to be put
> into the log a second time.

I don't see us logging in pool.endJob anywhere. Perhaps someone has registered a job listener listening for the done event and logging an extra time. Do you have the stack traces?
Comment 5 Curtis Windatt CLA 2010-02-11 14:53:15 EST
It appears that the ProgressManager has a listener that is doing the logging.  It is also responsible for opening the error dialog (which is wanted behaviour).  I debugged as far as ProgressManager (line 449).  The JobChangeAdapter.done() calls:

StatusManager.getManager().handle(statusAdapter,StatusManager.SHOW | StatusManager.LOG);

We would like to have the error be displayed to the user and logged.  However, having it logged twice (once by the ProgressManager and again by the Worker) is not preferable.

Reducing severity to minor.
Comment 6 John Arthorne CLA 2010-02-11 15:32:07 EST
I agree. The ProgressManager should not log it. Since the core jobs mechanism needs to handle the case where there is no ProgressManager, it's best to do the logging only once at the lowest level to ensure it is always logged.
Comment 7 Prakash Rangaraj CLA 2010-02-22 01:50:44 EST
The logging was introduced because of Bug# 277081.

John,

   Does the core jobs handle NPE situations during an async execution? If so, then ProgressManager can be made not to log the error.
Comment 8 John Arthorne CLA 2010-02-22 10:05:33 EST
(In reply to comment #7)
>    Does the core jobs handle NPE situations during an async execution? If so,
> then ProgressManager can be made not to log the error.

It looks like we don't. I think this is a bug in the job bundle, since we log failures for normal jobs, but not for job with asynchronous completion. I suggest reverting your change in ProgressManager and I will fix the job implementation to log consistently. I will reopen bug 277081 and move it to me to properly log in that case. I will leave this bug for making the change on the UI side.
Comment 9 John Arthorne CLA 2010-02-22 10:16:34 EST
Created attachment 159793 [details]
Fix to remove double logging
Comment 10 John Arthorne CLA 2010-02-22 10:18:42 EST
I'm going to go ahead and release this, since I have released the change on the jobs side for tomorrow's build and want to avoid seeing double-logging of everything. Prakash, please review.
Comment 11 Prakash Rangaraj CLA 2010-03-10 00:34:40 EST
Verified in I20100309-0100