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

events: emit event when job is deleted #19903

Merged
merged 2 commits into from Feb 9, 2024
Merged

Conversation

lgfa29
Copy link
Contributor

@lgfa29 lgfa29 commented Feb 7, 2024

When jobs are deregistered with the purge flag they are immediately deleted from the state store instead of just updated to be marked as stopped.

Without tracking job deletions the event stream would not receive a JobDeregistered event when purge was set.

Ref. #19834

When jobs are deregistered with the `purge` flag they are immediately
deleted from the state store instead of just updated to be marked as
stopped.

Without tracking job deletions the event stream would not receive a
`JobDeregistered` event when `purge` was set.
@lgfa29 lgfa29 added the backport/1.7.x backport to 1.7.x release line label Feb 7, 2024
@@ -726,7 +726,7 @@ func TestEventsFromChanges_WithDeletion(t *testing.T) {
event := eventsFromChanges(nil, changes)
require.NotNil(t, event)

require.Len(t, event.Events, 1)
require.Len(t, event.Events, 2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was testing something else (5e34efa), but incidentally assumed that a job deletion would not generate an event.

Copy link
Contributor

@pkazmierczak pkazmierczak left a comment

Choose a reason for hiding this comment

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

LGTM!

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!

@lgfa29 lgfa29 merged commit e2bfdf0 into main Feb 9, 2024
19 checks passed
@lgfa29 lgfa29 deleted the f-event-stream-job-purge branch February 9, 2024 23:19
nvanthao pushed a commit to nvanthao/nomad that referenced this pull request Mar 1, 2024
When jobs are deregistered with the `purge` flag they are immediately
deleted from the state store instead of just updated to be marked as
stopped.

Without tracking job deletions the event stream would not receive a
`JobDeregistered` event when `purge` was set.
nvanthao pushed a commit to nvanthao/nomad that referenced this pull request Mar 1, 2024
When jobs are deregistered with the `purge` flag they are immediately
deleted from the state store instead of just updated to be marked as
stopped.

Without tracking job deletions the event stream would not receive a
`JobDeregistered` event when `purge` was set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.7.x backport to 1.7.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants