[
https://jira.jboss.org/browse/JBPM-2930?page=com.atlassian.jira.plugin.sy...
]
Per Christian Henden commented on JBPM-2930:
--------------------------------------------
I came across org.jbpm.pvm.internal.jobexecutor.JobExecutor#getIdleMillisMax. Using that
field's value may be a better solution than introducing a new constant, like done in
the patch I attached. The core issue here is to avoid 'currentIdleInterval' to
grow without bounds when there are many exceptions in a row.
IllegalArgumentException on error path in DispatcherThread
----------------------------------------------------------
Key: JBPM-2930
URL:
https://jira.jboss.org/browse/JBPM-2930
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: jBPM 4.4
Environment: JBPM 4.4 upgraded from 4.3, JDK 1.6u21.
Reporter: Per Christian Henden
Attachments: JBPM-2930-patch.diff, ois-bpm-logg.txt
DispatcherThread waits before retrying to execute a Job when there is an error. If there
are multiple failures in a row, the wait period is increased in the following manner:
int currentIdleInterval = jobExecutor.getIdleMillis(); //Typically a few seconds
while(isActive) {
....
catch (Exception e) {
...
semaphore.wait(currentIdleInterval);
...
currentIdleInterval = currentIdleInterval * 2;
...
}
}
In other words, currentIdleInterval grows without bounds. Eventually the integer
currentIdleInterval will overflow and semaphore.wait() will throw
java.lang.IllegalArgumentException: timeout value is negative, resulting in a crash.
In my case an error occurs because there are timers that refer to inactive executions
(because timers that have not fired are not deleted when a subprocess ends in JBPM 4.3).
This has left me with some 340 rows in JBPM4_JOB that refers to a non-existing execution.
Another aspect of this problem is that the retry-wait can grow to unreasonably large
values, for example multiple days, and if my calculations are correct, multiple years.
A simple fix is to introduce an upper bound of for example 256 *
jobExecutor.getIdleMillis(), and not increase currentIdleInterval above that.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira