We have a simple script task in a BPMN that is within a loop that is designed to loop around 500 times. The script task simply creates a string variable. We can see when we don't mark the script as asynchronous, we see a StackOverflowError after around 30 loops occur. If we mark it as asynchronous, we do not see the error.
Is there any indication why this occurs specifically with script tasks and not with any other tasks such as service tasks?
After writing the recursive logic, the stack will be expanded, so StackOverflowError will occur.
How about increasing the thread stack size with JVM parameters?
-Xss:10m
This is also something but we would need to be able to scale the stack if request and load increases on activiti, which is why I was wondering if there was something specific that only seems to cause it with script tasks in a loop, or indeed if there is an activiti element that can stop it occuring?
Since the Xss option is related to the maximum value, I think the thread size will be expanded as necessary.
If we need to examin why the stack will be expanded, we need to check your script.
Makes sense. The script was simply creating an integer variable and adding 1 to it, but it is possible it can run thousands of times due it it being in a loop.
Well, please upload the reproduction code (>_<) if you wanto to resolve this problem.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.