]
HuiSheng Xu resolved JBPM-2930.
-------------------------------
Fix Version/s: jBPM 4.5
(was: jBPM 4.x)
Resolution: Done
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
Assignee: HuiSheng Xu
Fix For: jBPM 4.5
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: