Setting a timeout on a service task in Activiti

cancel
Showing results for 
Search instead for 
Did you mean: 
zlatan316
Active Member

Setting a timeout on a service task in Activiti

Hi,

What is the correct way to increase the timeout associated with Service Tasks only being able to stay 'active' for a set time? Long running tasks executed within a Service Task will cause a timeout due to a transaction to a database being open for too long. While I understand there is the notion to delegate the responsiblity for running the long running process externally from activiti by using Message Events, I would specifically like to have it stay within a Service Task and have the timeout increased.

4 Replies
gdharley
Intermediate

Re: Setting a timeout on a service task in Activiti

Hi,

I may be missing something, but as far as I know, there is no explicit or implicit timeout associated with service tasks.

Perhaps you are referring to the job executor timeout.

If a service task is marked to run asynchronously or is on a thread that was launched by the job executor, then the job must finish within the designated timeout, otherwise it will be assumed to have failed and a retry will be triggered.

By default, the timer and async service job timeout is 5 minutes.

If you need to extend this, you may do so globally in the engine configuration.

A word of warning, long running service calls hold threads active and can lead to thread starvation in the job executor.

Cheers,

Greg

ravenblackdusk
Active Member

Re: Setting a timeout on a service task in Activiti

That does not really solve my problem since it seems that job executor timeout will be applied to tasks that are started by timer or perhaps by message and such. I need timeouts for any service task. A service task that immediately follows start event will be executed in the application server(tomcat) threads and I want to make sure malicious service tasks do not exhaust tomcat thread pool or other resources(CPU time, memory, ...).

chiojar
Member II

Re: Setting a timeout on a service task in Activiti

Hello

I'm suffering the same thing as you did you already resolved? can you share, if it's possible, what the solution was?

Thanks in advance.

Regards

Venkateshp
Member II

Re: Setting a timeout on a service task in Activiti

Hello,

   Next step in the workflow needs to be manually restart when previous step executes for than an hour. Is there any configuration to setup in Activiti version 5.17.0 version.