Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore setting job summary when oldstatus == newstatus #9884

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

drewbailey
Copy link
Contributor

@drewbailey drewbailey commented Jan 25, 2021

Ignoring setting job summary when job status has not changed.

firstPass was an invalid approach to prevent double job summary updates since applyUpsertJob calls setJobStatus twice, once during UpsertJob and once during UpertEval (atomic eval insertion).

When setting the job status, if oldstatus == newstatus, truly no-op instead of calculating the Jobsummary.

Before #9768, setJobStatus set oldStatus = "" which allowed the job summary to increment and decrement properly

https://github.com/hashicorp/nomad/blob/release-1.0.1/nomad/state/state_store.go#L4482-L4484

The current situation seems to be mostly related to test setup, before we could rely on the implementation to empty out the job status when it was created, but in reality the job comes in through the FSM without a job status set.

fixes #9875

Copy link
Contributor

@notnoop notnoop left a comment

Choose a reason for hiding this comment

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

Good catch - lgtm.

@drewbailey drewbailey merged commit 85129bb into master Jan 25, 2021
@drewbailey drewbailey deleted the b/double-job-summary branch January 25, 2021 15:34
@tgross tgross added this to the 1.0.3 milestone Jan 25, 2021
@tgross tgross added the hcc/cst Admin - internal label Jan 26, 2021
@github-actions
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 Nov 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hcc/cst Admin - internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in periodic job summaries: pending never decreases
3 participants