[
https://jira.jboss.org/jira/browse/JBPM-2780?page=com.atlassian.jira.plug...
]
Alejandro Guizar commented on JBPM-2780:
----------------------------------------
the JobExecutor stops all running JobExecutorThreads by calling
"stop()" on them. This interrupts the thread.
This description is not accurate. JobExecutor stops JobExecutorThreads by invoking the
deactivate() method. deactivate() follows the suggestions for stopping threads that wait
for long periods outlined in
http://java.sun.com/j2se/1.4.2/docs/guide/misc/threadPrimitiveDeprecation...
Thread::interrupt() throws an InterruptedException to the target thread, but only if the
thread is blocked in a call to Object.wait or Thread.sleep among other blocking methods.
Otherwise, the interrupt status is set and the thread keeps running. Blocking methods are
designed to throw an InterruptedException if the calling thread has its interrupt status
set.
If a JobExecutorThread is executing a job at the time of deactivation, the job runs till
finished. Only then the JobExecutorThread checks its isActive flag and ceases execution.
Graceful stop of JobExecutor
----------------------------
Key: JBPM-2780
URL:
https://jira.jboss.org/jira/browse/JBPM-2780
Project: jBPM
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Affects Versions: jBPM 3.2.8
Reporter: Bernd Ruecker
Assignee: Alejandro Guizar
Currently when stopping the JobExecutor it stops all running JobExecutorThreads by
calling "stop()" on them. This interrups the thread.
In a scenario where you want to do a "clean" stop (e.g. shutdown the server),
there should be a mechanism to stop the JobExecutor, but let it finish currently executed
jobs and wait for it.
For the implementation it is not hard, I could provide a patch for it as well. Since a
customer currently needs it, it would be nice to commit it to the next released jbpm 3.2.x
version.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira