My Job's Progress Bar Won't Go Away [message #508164] |
Sat, 16 January 2010 17:48  |
Eclipse User |
|
|
|
This is my first plugin, so be gentle. I can't figure this out!
I have a task that the user initiates with a button on my plugin view. This task can take a while so I put it into a Job and schedule it for ASAP execution. If I use the IProgressMonitor given to my job's run() method such that in the run method I call monitor.beginTask(String,int) and then monitor.worked(1) for each unit of work done, then in a finally block call monitor.done(), MOST of the time the progress view's job will not only show up and grow the progress indicator bar across from left to right, but it will also:
1. Not move it to 100% but some percentage short (seems consistent how far it goes), and
2. Not remove the job from the progress view.
Debugging shows me that (a) no errors occur in my code, (b) I in fact DO call monitor.worked(1) the exact # of times that match the 2nd parameter to monitor.beginTask(), and (c) monitor.done() is definitely called.
AND... here's the really painful part: if I set a breakpoint on monitor.done(), then continue VM execution, the progress job disappears as it should.
So it seems like some kind of race condition perhaps, since when I trigger this breakpoint I'm stopping the job's thread but not all threads?
One last bit to throw into play: when the job thingie lingers, the cancel button in the progress window for this job is still red and active, and I can click it and the job disappears. So it is not like the progress monitor thinks the job is done and just waiting for me to dismiss it.
So... anyone know what is going on here?
I'm baffled!
(PS. if I stop using monitor.beginTask(), worked() and done() altogether, while I don't see the progress bar, the job DOES seem to go away when done pretty consistently.)
|
|
|
|
|
|
|
Re: My Job's Progress Bar Won't Go Away [message #651451 is a reply to message #651378] |
Sun, 30 January 2011 22:54  |
Eclipse User |
|
|
|
On 30/01/11 11:23 AM, Dan Watson wrote:
> I still haven't figured it out, but its definitely still an issue. It
> occurs in IDE launches, and also in the final exported RCP product. I
> cant help but think that I'm doing something incorrectly with the
> progress monitor, but I cant imagine what it is.
>
> The tool im building is almost purely personal, so this isn't a show
> stopper, but its definitely annoying enough to want to look into. If I
> do give the tool to other users its going to be extremely confusing the
> first time they think a Job is still running when its already complete.
I can investigate, if someone posts the code/steps to reproduce.
--
- Prakash
Platform UI Team, IBM
www.eclipse-tips.com
|
|
|
Powered by
FUDForum. Page generated in 0.06051 seconds