Skip to content

bug fix: paused deployments failing progress deadline - #27804

Merged
tehut merged 5 commits into
mainfrom
b-paused-deployment-timeout/nmd-1080
Apr 29, 2026
Merged

tehut merged 5 commits into
mainfrom
b-paused-deployment-timeout/nmd-1080

Conversation

@tehut

@tehut tehut commented Apr 7, 2026 •

Copy link
Copy Markdown
Contributor

Bug:
Support informed us of customers running into counterintuitive behavior where deployments were failing their progress deadline while paused.

Fix:

The changes below are intended make sure deployments don't fail as soon as they're un-paused

  • Updated the deploymentwatcher.getDeploymentStatusUpdate function to set an UpdatedAt time if the new deployment status is "paused" or "running" (might make sense to only reset on running instead of both)
  • Update the state store's updateDeploymentStatusImpl function to overwrite the deployment's ProgressDeadline with the UpdatedAt time + ProgressDeadline duration if neither u.UpdatedAt nor u.ProgressDeadline are 0.

Testing & Reproduction steps

  • Added an additional test case to deployments_watcher_test.go to assert:
    - that a paused deployment past its progress deadline will not fail
    - that the deployment's progress deadline == UpdatedAt + ProgressDeadline

Links

ref: https://hashicorp.atlassian.net/browse/NMD-1080?atlOrigin=eyJpIjoiMDI5YTFlZjZiMGM2NGQ4MWIwMDU1NjBhZDFjNzFiNjciLCJwIjoiaiJ9

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad product documentation, which is stored in the
    web-unified-docs repo. Refer to the web-unified-docs contributor guide for docs guidelines.
    Please also consider whether the change requires notes within the upgrade
    guide
    . If you would like help with the docs, tag the nomad-docs team in this PR.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.
  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Ensure UpdatedAt is set in DeploymentStatusUpdate
Reset RequireProgressBy during update
Test that paused deployment skips progress check
@tehut tehut added backport/ent/1.10.x+ent backport to 1.10.x+ent release line backport/ent/1.11.x+ent backport to 1.11.x+ent release line backport/2.0.x backport to 2.0.x release line backport/ent/2.0.x+ent backport to 2.0.x+ent release line labels Apr 13, 2026
@tehut
tehut marked this pull request as ready for review April 13, 2026 22:03
@tehut
tehut requested review from a team as code owners April 13, 2026 22:03
@tehut
tehut requested a review from gulducat April 15, 2026 15:29
@tehut tehut changed the title B paused deployment timeout/nmd 1080 bug fix: paused deployments failing progress deadline Apr 15, 2026
gulducat
gulducat previously approved these changes Apr 15, 2026

@gulducat gulducat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I have only one nit to pick.

Comment on lines 671 to +674
fail = false
if d.Status == structs.DeploymentStatusPaused {
return fail, false, nil
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not your addition, and this is a super nit, but: it feels a bit odd to return fail immediately after its assignment to false. I more expect its assignment before a situation where it might change.

we don't even really need it at all, since it's a named return whose default zero value is false, but if we want to keep it, then I vote:

Suggested change
fail = false
if d.Status == structs.DeploymentStatusPaused {
return fail, false, nil
}
// never time out a paused deployment
if d.Status == structs.DeploymentStatusPaused {
return false, false, nil
}
fail = false

@tehut tehut Apr 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me! Swapped it to false.

But now you have me wondering if maybe it was reset to false here just to make sure the value was zero'd out before the stanza below where it could be set to true. Which really shouldn't be an issue but things get weird in this long running loops so 🤷

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your patch isn't quite the same as my suggestion, but it was a nit anyway 🙃

@tehut
tehut merged commit 520a7cc into main Apr 29, 2026
37 checks passed
@tehut
tehut deleted the b-paused-deployment-timeout/nmd-1080 branch April 29, 2026 18:26
@github-actions

Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 28, 2026

This branch was successfully deployed

1 active deployment
Preview — d7b73978 Deployed Apr 15, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/ent/1.10.x+ent backport to 1.10.x+ent release line backport/ent/1.11.x+ent backport to 1.11.x+ent release line backport/ent/2.0.x+ent backport to 2.0.x+ent release line backport/2.0.x backport to 2.0.x release line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants