-
Bug
-
Resolution: Done
-
Minor
-
7.59.0.Final
-
None
-
False
-
False
-
NEW
-
NEW
-
undefined
-
There are unlikely test failures at DeploymentServiceCDIImplWithSyncTest testDeploymentOfProcessesBySync and testUndeploymentOfProcessesBySync due to uncommitted changes in the updateDate of the DeploymentStore.
The failing scenario is the following one:
- DeploymentSynchronizer synchronize method is invoked every 3 seconds to retrieve updates of the DeploymentStore based on this named-query (getDeploymentUnitsByDate):
- ludate is the syncDate calculated as current datetime before the query and stored till the next execution.select d from DeploymentStoreEntry d where d.updateDate >= :ludate
- But if this query is executed during this part of enableDeploymentUnit (similar in disable, et others) https://github.com/kiegroup/jbpm/blob/1ca5f6e345182f555b920832b8d1bbcaf4ef0434/jbpm-services/jbpm-kie-services/src/main/java/org/jbpm/kie/services/impl/store/DeploymentStore.java#L165-L173
Then, that DeploymentStore is not "visible" (not committed yet) but "skipped" by the synchronizer.
Therefore, when committed, it would be lower than the new syncDate, being lost for the synchronizer.
Proposal:
Use a margin of -1 second in the lastSync date, to retrieve overlapping intervals, looking also for DeploymentStores which have been committed (and not detected) during the previous execution.