2nd Process Instance getting delayed if 1st Process Instance Service Task is executing

Hi All,

This is my process Instance,

sleepCrop

Both the service task are async=false. Inside the service task, there is a

System.out.println(“Service Task Called…” +exec.getProcessInstanceId());
Thread.sleep(60000);
System.out.println(“Service Task Completed…”);

Both service task uses the same code. So they will be executed sequentially by the main process engine thread. But when i start a new process instance, while the service task 1 of 1st process instance is executing, the service task 1 of process instance 2 is getting delayed by like 6-7 secs before it is getting executed ie. i am getting 1st sysout statement from service task for process instance 2 after 6-7 secs after starting the process. Can someone explain me the behavior.

Thanks,
Arpit Agrawal

Looks like its not a flowable issue. Did some logging and found that maybe its because of the tomcat. I have a rest API which start the process. Now if i hit this API from 2 tabs, 1st tab request get executed immediately while 2nd request is delayed by exaclty 20 sec each time. I am using tomcat to deploy the WAR file. can someone help me here.

Edit : After further investigation, looks like its not a tomcat issue as well because my other APIs like login are responding correctly in 2nd tab but when after login, frontend hits the API that actually initiates the process, its getting delayed while the process is being executed that was started on tab 1 of same browser. If i hit 2nd request from a different machine its getting executed correctly, only facing problem when executing from same machine but in 2 different tabs. It looks like (haven’t explored this) that inside the request filter it is getting delayed because login api is ignored from the filter chain using

@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/login").antMatchers("/dashboard/login");
}

Can someone help me???

Edit 2: Looks like it was a chrome issue. Found that chrome stall the request, if their is already a pending request for same resource, so that it can check if it can use cached resource.

Extremely sorry for the trouble!!!

Thanks,
Arpit Agrawal