Skip to content

Conversation

mismithhisler
Copy link
Member

Description

This change removes some logic from the getJobStatus() method in order to remove the call to time.Now(). With this logic removed, we revert back the edge case where jobs that should be pending can be marked dead for a very brief period of time until an evaluation is created for them.

Testing & Reproduction steps

Links

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 website documentation to reflect this. Refer to
    the website README for docs guidelines. Please also consider whether the
    change requires notes within the upgrade guide.

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.

The reschedulable check was using a call to time.Now() which should not
be called within the state store.
@mismithhisler mismithhisler self-assigned this Feb 10, 2025
@mismithhisler mismithhisler marked this pull request as ready for review February 10, 2025 17:05
@mismithhisler mismithhisler requested review from a team as code owners February 10, 2025 17:05
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM!

An unfortunate edge case to have to leave in, for sure, but we probably should fix this by making the job register + evaluation write atomic anyways.

@mismithhisler mismithhisler added the backport/1.9.x backport to 1.9.x release line label Feb 10, 2025
@mismithhisler mismithhisler merged commit b5c157d into main Feb 10, 2025
31 of 32 checks passed
@mismithhisler mismithhisler deleted the f-remove-time-function-from-fsm branch February 10, 2025 17:21
Copy link

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 Jun 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.9.x backport to 1.9.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants