Skip to content

Commit

Permalink
prevent pending request deletion of new scheduled task deploy on star…
Browse files Browse the repository at this point in the history
…tup with outdated running task
  • Loading branch information
William Hou committed Nov 5, 2021
1 parent a3a50e9 commit 22e0dea
Showing 1 changed file with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,25 @@ private void handlePendingRequestsForDeployKey(
pendingRequest,
maybePendingDeploy
);
if (
missingInstances == 0 &&
!matchingTaskIds.isEmpty() &&
updatedRequest.isScheduled() &&
pendingRequest.getPendingType() == PendingType.NEW_DEPLOY
) {
boolean scheduledRequestWithActiveTask =
(
missingInstances == 0 &&
!matchingTaskIds.isEmpty() &&
updatedRequest.isScheduled() &&
pendingRequest.getPendingType() == PendingType.NEW_DEPLOY
);
boolean scheduledRequestWithOutdatedActiveTask =
(
missingInstances == 0 &&
matchingTaskIds.isEmpty() &&
updatedRequest.isScheduled() &&
(
pendingRequest.getPendingType() == PendingType.NEW_DEPLOY ||
pendingRequest.getPendingType() == PendingType.STARTUP
)
);

if (scheduledRequestWithActiveTask || scheduledRequestWithOutdatedActiveTask) {
LOG.trace(
"Holding pending request {} because it is scheduled and has an active task",
pendingRequest
Expand Down

0 comments on commit 22e0dea

Please sign in to comment.