Skip involvement into dynamic rollout only when idle (#1800)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-08-02 12:40:46 +03:00
committed by GitHub
parent 2f2dbf1d2b
commit 0afd7e8036

View File

@@ -688,8 +688,6 @@ public class JpaRolloutExecutor implements RolloutExecutor {
if (now - lastFill.get() < repositoryProperties.getDynamicRolloutsMinInvolvePeriodMS()) {
// too early to make another dynamic involvement attempt
return false;
} else {
lastFill.set(now);
}
RolloutHelper.verifyRolloutInStatus(rollout, RolloutStatus.RUNNING);
@@ -702,6 +700,7 @@ public class JpaRolloutExecutor implements RolloutExecutor {
if (currentlyInGroup >= expectedInGroup || group.getStatus() == RolloutGroupStatus.FINISHED) {
// the last one is full. create new and start filling it on the next iteration
createDynamicGroup(rollout, group, rolloutGroups.size(), RolloutGroupStatus.SCHEDULED);
// don't update lastFill - want to run again next time to start filling in
return true;
}
@@ -732,11 +731,16 @@ public class JpaRolloutExecutor implements RolloutExecutor {
// TODO - try to return false and proceed with handleRunningRollout
// the problem is that OptimisticLockException is thrown in that case
// don't update lastFill - want to run again next time in case there are more
return true;
}
} catch (final TransactionException e) {
log.warn("Transaction assigning Targets to RolloutGroup failed", e);
}
// set to skip for some time
lastFill.set(now);
return false;
}