Multiple Job task

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple Job task

Changseok Keum

Hi All,

I am trying to do test for provisioning of multiple tables(actually two tables) on an external database.

For the test, I created connectors, resourses and pull tasks for each tables, and executed two tasks at the almost same time.

I expected the tasks were going to be executed concurrently, but it did not.

And then I explored provisioning source codes and a found DisallowConcurrentExecution quartz annotation on AbstractInterruptableJob class on which TaskJob class extended.

Is it right concept for tasks to be executed not concurrently? Or I missed something important?

Always thanks.

BR,
Changseok Keum

Reply | Threaded
Open this post in threaded view
|

Re: Multiple Job task

ilgrosso
Administrator
On 21/11/2016 12:29, Changseok Keum wrote:

>
> Hi All,
>
> I am trying to do test for provisioning of multiple tables(actually
> two tables) on an external database.
>
> For the test, I created connectors, resourses and pull tasks for each
> tables, and executed two tasks at the almost same time.
>
> I expected the tasks were going to be executed concurrently, but it
> did not.
>
> And then I explored provisioning source codes and a found
> DisallowConcurrentExecution quartz annotation on
> AbstractInterruptableJob class on which TaskJob class extended.
>
> Is it right concept for tasks to be executed not concurrently? Or I
> missed something important?
>

Hi,
Quartz's @DisallowConcurrentExecution [1] ensures that there are no
multiple instances of the same Job class executed concurrently (where
instance is based-upon a JobDetail definition - or in other words based
upon a JobKey).

In other words, it is not the fact that you are concurrently executing
two instances of the TaskJob [2] class that matters, but rather the
associated JobKey, which is in this case built by [3] and depends on the
effective key, e.g. the UUID generated for the task.

As a result, there is nothing blocking two distinct PullTask instances
to run concurrently.

There are, however, specific conditions to met, in order to effectively
run propagation tasks concurrently; you can read more about this aspect
at [4].

HTH
Regards.

[1]
http://www.quartz-scheduler.org/api/2.2.1/org/quartz/DisallowConcurrentExecution.html
[2]
https://github.com/apache/syncope/blob/2_0_X/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/TaskJob.java
[3]
https://github.com/apache/syncope/blob/2_0_X/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/job/JobNamer.java#L58
[4] https://syncope.apache.org/docs/reference-guide.html#propagation

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/