Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » My Job's Progress Bar Won't Go Away(IProgressMonitor Woes)
My Job's Progress Bar Won't Go Away [message #508164] Sat, 16 January 2010 22:48 Go to next message
Scott Hamilton is currently offline Scott HamiltonFriend
Messages: 5
Registered: January 2010
Junior Member
This is my first plugin, so be gentle. Smile 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 #508249 is a reply to message #508164] Mon, 18 January 2010 05:22 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 17/01/10 4:19 AM, Scott Hamilton wrote:
> 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.

What you have done seems to be right. Can you attach a sample code to
reproduce it?

- Prakash
Platform UI Team, IBM

Blog <http://blog.eclipse-tips.com>
Twitter <http://www.twitter.com/Eclipse_Tips>
Re: My Job's Progress Bar Won't Go Away [message #651144 is a reply to message #508164] Thu, 27 January 2011 23:51 Go to previous messageGo to next message
Dan Watson is currently offline Dan WatsonFriend
Messages: 2
Registered: July 2009
Junior Member
I realize this is a really old post, but has anyone solved this? Im seeing this behavior in an Eclipse 3.6 plugin. Its very spotty, maybe 5/10 times the Job row remains incomplete in the progress view, even though the Job class has definitely finished running and exited the run method. I'm watching the console to confirm that beginTask() , worked() and done() are being called correctly on the monitor object.
Re: My Job's Progress Bar Won't Go Away [message #651271 is a reply to message #651144] Fri, 28 January 2011 16:28 Go to previous messageGo to next message
Scott Hamilton is currently offline Scott HamiltonFriend
Messages: 5
Registered: January 2010
Junior Member
For my part I was never able to resolve this. It was a long time ago so I don't recall ALL the different things I tried, but in the end, since the particular project is an internal tool and not something we're trying to sell, it was "good enough" and I could let it be.

Still, I'd *love* to know what causes it and how to fix it!
Re: My Job's Progress Bar Won't Go Away [message #651378 is a reply to message #508164] Sun, 30 January 2011 05:52 Go to previous messageGo to next message
Dan Watson is currently offline Dan WatsonFriend
Messages: 2
Registered: July 2009
Junior Member
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.

Re: My Job's Progress Bar Won't Go Away [message #651451 is a reply to message #651378] Mon, 31 January 2011 03:54 Go to previous message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
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
Previous Topic:Export Plugin as Eclipse Product
Next Topic:Extending the Manifest Editor's functionality
Goto Forum:
  


Current Time: Sat Aug 08 11:55:57 GMT 2020

Powered by FUDForum. Page generated in 0.02465 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top