-
Notifications
You must be signed in to change notification settings - Fork 2k
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
prevent double job status update; periodic job count miscalculation #9768
Conversation
2e5b57a
to
1c37af8
Compare
require.NotEmpty(t, childID) | ||
|
||
testutil.WaitForResult(func() (bool, error) { | ||
status, err := e2eutil.JobInspectTemplate(jobID, `{{with index . 1}}{{printf "%s" .Status}}{{end}}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really slick 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for digging into this!
93a65ef
to
74030f7
Compare
After the initial review, there were multiple state_store specs failing. Removing the This fixed most the failing tests, but |
74030f7
to
a4405a9
Compare
}) | ||
|
||
t.Run("no listeners", func(t *testing.T) { | ||
result := gatewayBindAddresses(&structs.ConsulIngressConfigEntry{Listeners: nil}) | ||
require.Nil(t, result) | ||
require.Empty(t, result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shoenig requested re-review, this commit seems to deviate from how a bit of the consul gateway empty values are handled
#8435 introduced atomic eval insertion iwth job (de-)registration. This change removes a now obsolete guard which checked if the index was equal to the job.CreateIndex, which would empty the status. Now that the job regisration eval insetion is atomic with the registration this check is no longer necessary to set the job statuses correctly.
fix nil assertions for empty map rm unnecessary guard
b1c5848
to
f35eee3
Compare
* Prevent Job Statuses from being calculated twice #8435 introduced atomic eval insertion iwth job (de-)registration. This change removes a now obsolete guard which checked if the index was equal to the job.CreateIndex, which would empty the status. Now that the job regisration eval insetion is atomic with the registration this check is no longer necessary to set the job statuses correctly. * test to ensure only single job event for job register * periodic e2e * separate job update summary step * fix updatejobstability to use copy instead of modified reference of job * update envoygatewaybindaddresses copy to prevent job diff on null vs empty * set ConsulGatewayBindAddress to empty map instead of nil fix nil assertions for empty map rm unnecessary guard
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. |
#8435 introduced atomic eval insertion when registering/de-registering jobs.
This change removes a now obsolete guard which checked if the index was
equal to the job.CreateIndex, which would empty the status.
Now that the job regisration eval insertion is atomic with the registration
this check is no longer necessary to set the job statuses correctly
By preventing the double job status calculation, we also need to ensure that job summary is properly calculated. This ensures the job summary is calculated correctly, even if the job status does not change.
fixes #8692