Hi Francesco,
Thanks for the responses.
I wanted to ask about your last paragraph:
"FYI, when in need to orchestrate more Sched / Pull / Push tasks, I normally 
define an additional Sched task for such a purpose which triggers the others, 
and finally run / schedule this last one."
Are you saying that if we use a single SCHEDULED task to run the 4 tasks that 
we need to run (2 PULL tasks and 2 PUSH tasks, in the following order, PULL, 
then a PUSH, then a PUSH, and finally another PULL), that then, the 4 tasks 
that are run by the SCHEDULE task would be guaranteed to run sequentially, one 
after the other?

FYI, the problem that we are having now, running the 4 tasks individually is 
that if we run the 4 tasks (from a shell script) and depending on the number of 
users we are handling, if we don't put enough delay between running each of the 
4 tasks, then something is going wrong.   

[We think this is because when we run one of the individual tasks, that task 
has not completed its work, and meanwhile one or more of the other tasks is 
running.]
Also, the amount of delay that we have to add between running each of the 4 
tasks gets (relatively) VERY long (e.g., in one test with 18 users, I had to 
make the between task delay 50 secs), even for a relatively small number of 
users, and right now, the only way we can determine what the right amount of 
delay is to run the script (which has a delay between each task command) and 
then check the results after all 4 tasks have run, to see if we have the 
"expected results".
So, if, running the 4 tasks "under" a scheduled task would guarantee that each 
of the individual tasks would finish running completely, before the next task 
under the scheduled task runs, then that would be perfect!
Thanks,Jim


    On Tuesday, January 21, 2020, 7:48:53 AM UTC, Francesco Chicchiriccò 
<[email protected]> wrote:  
 
  Hi,
  
   
 [...] we have not been able to find a way, using either CLI or REST, to find 
out when the task has completed.
 Can someone tell me how, using either the CLI or REST API (or even the Mysql 
database), we can determine that? 
  
  curl -X GET "http://host:port/syncope/rest/tasks/SCHEDULED/XXX?details=true"; 
-H "Accept: application/json"
  
  where XXX is the task key; replace SCHEDULED with PULL for Pull Tasks and 
with PUSH for Push Tasks.
  
  The returned payload will contain an "executions" array where you can inspect 
the completed executions of the given task, e.g. if XXX was completed, and with 
which results. 
  Please note that, for Propagation, Push and Pull, executions will be stored 
only when appropriate trace levels were set on the associated External Resource 
- see [1].
  
 I wouldn't suggest playing too much with Quartz settings in Syncope, but if 
you really want to do so, the Quartz configuration is defined in [2]. All jobs 
defined implement [3] hence feature Quartz's [4] and [5].
 
 FYI, when in need to orchestrate more Sched / Pull / Push tasks, I normally 
define an additional Sched task for such a purpose which triggers the others, 
and finally run / schedule this last one.
   
 Regards.
  
 
[1]http://syncope.apache.org/docs/2.1/reference-guide.html#external-resource-details
  
[2]https://github.com/apache/syncope/blob/2_1_X/core/provisioning-java/src/main/resources/provisioningContext.xml#L69-L99
 
[3]https://github.com/apache/syncope/blob/2_1_X/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/AbstractInterruptableJob.java
 [4]http://www.quartz-scheduler.org/api/2.3.0/org/quartz/InterruptableJob.html
 
[5]http://www.quartz-scheduler.org/api/2.3.0/org/quartz/DisallowConcurrentExecution.html
  
  On 18/01/20 03:41, [email protected] wrote:
  
 
 Hi, 
  Another thought that I had, if Syncope uses Quartz is:  Would it be possible 
to configure Quartz to a single thread at-a-time, and iw we could do that, 
would that prevent more than one Syncope tasks at-a-time? 
  Jim 
  
  
      On Saturday, January 18, 2020, 2:32:20 AM UTC, [email protected] 
<[email protected]> wrote:  
  
      Hi, 
  I've been digging around Syncope for the last several hours, trying to 
understand and figure out we might get this working.  We essentially want to be 
able to have tasks run sequentially, whereas it seems like Syncope tasks seem 
to run asynchronously (and, possibly, even in parallel?), and I noticed some 
Quartz libraries, so I am wondering/guessing if Syncope uses Quartz for 
executing tasks?  
  
  If Syncope is using Quartz, would it be possible to use the 
JobChainingJobListener that is mentioned in this thread: 
  
https://stackoverflow.com/questions/13486607/how-to-do-sequential-job-scheduling-quartz
 
    According to the 8/3/2015 post, that is available as part of Quartz 
scheduler. 
  Thanks, Jim
  
  
  
  
  
       On Friday, January 17, 2020, 8:37:06 PM UTC, [email protected] 
<[email protected]> wrote:  
  
      Hi, 
  We are running tasks using Syncope CLI and will be transitioning to using the 
REST API, but meanwhile, for some of the sequences of tasks that we run, the 
tasks within the sequence of tasks need to not be run until after the previous 
task has completed (not just triggered, but actually completed), but we have 
not been able to find a way, using either CLI or REST, to find out when the 
task has completed. 
  Can someone tell me how, using either the CLI or REST API (or even the Mysql 
database), we can determine that? 
  Thanks, Jim
              

 
 -- 
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/   

Reply via email to