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

applyUpsertJob causes duplicate job events in event stream #9507

Closed
drewbailey opened this issue Dec 3, 2020 · 3 comments
Closed

applyUpsertJob causes duplicate job events in event stream #9507

drewbailey opened this issue Dec 3, 2020 · 3 comments
Labels
theme/core theme/events Issues related to events

Comments

@drewbailey
Copy link
Contributor

When testing the event stream, we noticed when registering a job, multiple JobRegister events are added to the event stream.

This seems related to #8435. The logic in the state store to set the job status specifically empties out the current value if the index used to update the status is equal to the jobs create status.

oldStatus := job.Status
if index == job.CreateIndex {
oldStatus = ""
}

This causes a second insertion into the jobs table with an identical value to what was inserted previously in the job register step.

branch with test: https://github.com/hashicorp/nomad/compare/drew/job-status

@drewbailey drewbailey added theme/core theme/events Issues related to events labels Dec 3, 2020
@tgross
Copy link
Member

tgross commented Jan 26, 2021

@drewbailey should this be closed by #9768?

@drewbailey
Copy link
Contributor Author

Yep, thanks!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/core theme/events Issues related to events
Projects
None yet
Development

No branches or pull requests

2 participants