cancel
Showing results for 
Search instead for 
Did you mean: 

Timer start event slacking when multiplice processes are running

robinho
Champ in-the-making
Champ in-the-making
I have a timer startevent that starts a service task every 10 seconds.
the service task launches another independent asynchronous process that takes 2-3 days to finish.
Well, this works fine for the first 3-4 minutes.. after that, the timer startevent begins to launch itself approx 1-2 minute  instead of every 10 seconds..

What is the reason behind this? How can I fix this?

My activiti monitoring:
Memory usage:
1602MB / 1022MB used
Heap:
685MB / 1023MB used
10 REPLIES 10

robinho
Champ in-the-making
Champ in-the-making
It has nothing to do with the memory, I noticed

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Could you provide jUnit test for this issue?
https://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin

jbarrez
Star Contributor
Star Contributor
Which version? There used to be a version in the past where this indeed could happen.

Also, as Martin says, a unit test would help a lot here.

robinho
Champ in-the-making
Champ in-the-making
After the launch of the first 2 asynchronous processes, the timer slacks to a 1-2minute interval instead of 15seconds.
I'm using the latest actviti enterprise version

The process is really easy. TimerStartevent (15sec interval)=>servicetask(that launches another asynchronous process) => end event

I tried the following code in my servicetask, but without success:

<code>
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
  processEngine.getProcessEngineConfiguration().setAsyncExecutorActivate(true);
        processEngine.getProcessEngineConfiguration().setAsyncExecutorEnabled(true);
        AsyncExecutor asyncExecutor =  processEngine.getProcessEngineConfiguration().getAsyncExecutor();
        asyncExecutor.setMaxAsyncJobsDuePerAcquisition(100);
        asyncExecutor.setMaxTimerJobsPerAcquisition(1000);
        asyncExecutor.setDefaultAsyncJobAcquireWaitTimeInMillis(2000);
        asyncExecutor.setDefaultTimerJobAcquireWaitTimeInMillis(2000);
        asyncExecutor.setRetryWaitTimeInMillis(2000);
        processEngine.getProcessEngineConfiguration().setAsyncExecutor(asyncExecutor);
   RuntimeService runtimeService = processEngine.getRuntimeService();
  </code>

jbarrez
Star Contributor
Star Contributor
Hmm, that should just work … which version of Activiti are you using? Can you post your xml so we can verify it with the same process definition as you're seeing the problem with?

robinho
Champ in-the-making
Champ in-the-making
I'm using Alfresco Activiti Enterprise BPM Suitemaven 1.4.1

I posted my xml
Thank you for taking a look!

Info: MessagePoller should start an asynchronous TTSProcess every 15 seconds (this works for the first 2 asynchronous processes) After that, timer interval slacks to 1-2 minutes (the messagePoller process is taking quite a long time to finish)

robinho
Champ in-the-making
Champ in-the-making
I redesigned the 2 processes into 1 (which maybe a better option, or a even a solution).
Unfortunatly, the exact same problem is occuring..

See attachment.
Thanks



jbarrez
Star Contributor
Star Contributor
I've tried reproducing it here with a start timer event with R/PT15S, that goes to a script task that prints out a message …

but for me it nicely prints it out every 15 seconds:

Mon Mar 07 12:10:41 CET 2016 Hello world!
Mon Mar 07 12:10:56 CET 2016 Hello world!
Mon Mar 07 12:11:11 CET 2016 Hello world!
Mon Mar 07 12:11:26 CET 2016 Hello world!
Mon Mar 07 12:11:41 CET 2016 Hello world!
Mon Mar 07 12:11:56 CET 2016 Hello world!
Mon Mar 07 12:12:11 CET 2016 Hello world!
Mon Mar 07 12:12:26 CET 2016 Hello world!


I've attached my simple test (rename to .zip). Could you give it a spin on your env and post back what you see?

robinho
Champ in-the-making
Champ in-the-making
You made a synchronous task. I am talking about an asynchronous task. I used your example, made it asynchronous, created a thread.sleep on the service task.

I cannot find in the activiti documentation how to increase the async jobs, at the moment it is set at 2.
So the timer starts 2 processes waits until the sleep on the servicetask is done, and then starts another 2.
What is the common way to increase async jobs in alfresco activiti enterprise?

I tried
<code>
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
  processEngine.getProcessEngineConfiguration().setAsyncExecutorActivate(true);
        processEngine.getProcessEngineConfiguration().setAsyncExecutorEnabled(true);
        AsyncExecutor asyncExecutor =  processEngine.getProcessEngineConfiguration().getAsyncExecutor();
        asyncExecutor.setMaxAsyncJobsDuePerAcquisition(100);
        asyncExecutor.setMaxTimerJobsPerAcquisition(1000);
        asyncExecutor.setDefaultAsyncJobAcquireWaitTimeInMillis(2000);
        asyncExecutor.setDefaultTimerJobAcquireWaitTimeInMillis(2000);
        asyncExecutor.setRetryWaitTimeInMillis(2000);
        processEngine.getProcessEngineConfiguration().setAsyncExecutor(asyncExecutor);
</code>

Not working…
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.