Jobs cancelled by JobManagerAdapter? [message #792681] |
Tue, 07 February 2012 04:19  |
Eclipse User |
|
|
|
We are using RAP 1.3 R2.
We extensively use jobs for doing background work. Every now and then, it seems without any regular pattern, some jobs are cancelled and cannot be restarted from the GUI, they immediately go back to the CANCEL state.
After some investigation, we found one class that might explain this, but there may be other reasons too: The JobManagerAdapter works with the session management in order to cancel any jobs when their correponding session has expired. Additionally, the JobManagerAdapter adds a listener (JobCanceler()) to that job such that any callback, including scheduled(), immediately cancels the job. However, the error cannot be reproduced reliably.
So here are our questions:
# Is this the real cause for the problem?
# Is it the only cause for the problem?
# How can we schedule a job such that it will never be cancelled, even when the associated session times out? Ideally, we would like to schedule a job that is not associated with a session at all!
Many thanks and best regards,
BitCtrl
|
|
|
Re: Jobs cancelled by JobManagerAdapter? [message #794630 is a reply to message #792681] |
Thu, 09 February 2012 09:16   |
Eclipse User |
|
|
|
Hi Steffen,
currently, all jobs are bound to a session in RAP. If you want to
execute something out of a session just use a background thread directly.
Best,
Ivan
On 2/7/2012 11:19 AM, Steffen Gieseler wrote:
> We are using RAP 1.3 R2.
>
> We extensively use jobs for doing background work. Every now and then,
> it seems without any regular pattern, some jobs are cancelled and
> cannot be restarted from the GUI, they immediately go back to the
> CANCEL state.
>
> After some investigation, we found one class that might explain this,
> but there may be other reasons too: The JobManagerAdapter works with
> the session management in order to cancel any jobs when their
> correponding session has expired. Additionally, the JobManagerAdapter
> adds a listener (JobCanceler()) to that job such that any callback,
> including scheduled(), immediately cancels the job. However, the error
> cannot be reproduced reliably.
>
> So here are our questions:
> # Is this the real cause for the problem?
> # Is it the only cause for the problem?
> # How can we schedule a job such that it will never be cancelled, even
> when the associated session times out? Ideally, we would like to
> schedule a job that is not associated with a session at all!
>
> Many thanks and best regards,
> BitCtrl
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: Jobs cancelled by JobManagerAdapter? [message #796769 is a reply to message #792681] |
Sun, 12 February 2012 09:35   |
Eclipse User |
|
|
|
Steffen,
when a Job is scheduled, the the JobManagerAdapter tries to bind it to
the session/display that it is started on. This binding happens if
a) the Job is an instance of UI Job or
b) there is a request-service-context available. The thread that serves
the request is equipped with such a context.
Scheduling a Job without binding it to any session is currently only
possible with a hacky workaround. You'll have to create a thread (or
Job) that just starts the session-independant job. This way the
scheduling thread has no request-service-context attached and the
JobManagerAdapter doesn't find any session to bind the Job to.
Please feel free to file an enhancement request [1] for properly
expressing whether Jobs should be bound to a session or not (maybe by
using Job#setProperty).
HTH
Rüdiger
[1] http://eclipse.org/rap/bugs
On 07.02.2012 10:19, Steffen Gieseler wrote:
> We are using RAP 1.3 R2.
>
> We extensively use jobs for doing background work. Every now and then,
> it seems without any regular pattern, some jobs are cancelled and cannot
> be restarted from the GUI, they immediately go back to the CANCEL state.
>
> After some investigation, we found one class that might explain this,
> but there may be other reasons too: The JobManagerAdapter works with the
> session management in order to cancel any jobs when their correponding
> session has expired. Additionally, the JobManagerAdapter adds a listener
> (JobCanceler()) to that job such that any callback, including
> scheduled(), immediately cancels the job. However, the error cannot be
> reproduced reliably.
>
> So here are our questions:
> # Is this the real cause for the problem?
> # Is it the only cause for the problem?
> # How can we schedule a job such that it will never be cancelled, even
> when the associated session times out? Ideally, we would like to
> schedule a job that is not associated with a session at all!
>
> Many thanks and best regards,
> BitCtrl
--
Rüdiger Herrmann
http://codeaffine.com
|
|
|
|
|
|
|
Re: Jobs cancelled by JobManagerAdapter? [message #799754 is a reply to message #799729] |
Thu, 16 February 2012 04:19  |
Eclipse User |
|
|
|
Rüdiger,
thanks for the reply.
I currently working on the re-implementation of the jobs as background threads. The reason for not using your 'hacky workaround' is another problem with the JobManager we had in the past (I will create a new discussion for this).
At this time my problem is as follows: Our application is in production use (with the job problem). Until I release the update I have to explain under which conditions the problem occurs.
Thanks,
Steffen
|
|
|
Powered by
FUDForum. Page generated in 0.06245 seconds