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

Backport of nsd: always set deregister flag after deregistration of group into release/1.3.x #16536

Merged

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #16289 to be assessed for backporting due to the inclusion of the label backport/1.3.x.

WARNING automatic cherry-pick of commits failed. Commits will require human attention.

The below text is copied from the body of the original PR.


This PR fixes a bug where the group service hook's deregister flag was not set in Postrun(), causing the hook to attempt deregistrations twice during job updates (alloc replacement), where PreKill() would also do a deregistration. With the Nomad service provider, this shows up as Error logs on every job update.

First commit is the bug fix, second is drive by test cleanup.

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/nsd-fix-dregister-lock/merely-neutral-silkworm branch from 9a434bf to 034fe50 Compare March 17, 2023 14:44
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 17, 2023

CLA assistant check
All committers have signed the CLA.

(manual cherry-pick of ed498f8)

* services: always set deregister flag after deregistration of group

This PR fixes a bug where the group service hook's deregister flag was
not set in some cases, causing the hook to attempt deregistrations twice
during job updates (alloc replacement).

In the tests ... we used to assert on the wrong behvior (remove twice) which
has now been corrected to assert we remove only once.

This bug was "silent" in the Consul provider world because the error logs for
double deregistration only show up in Consul logs; with the Nomad provider the
error logs are in the Nomad agent logs.

* services: cleanup group service hook tests
@shoenig shoenig force-pushed the backport/nsd-fix-dregister-lock/merely-neutral-silkworm branch from e36cfba to bf3fce1 Compare March 17, 2023 15:02
@shoenig shoenig merged commit 2598e4f into release/1.3.x Mar 17, 2023
@shoenig shoenig deleted the backport/nsd-fix-dregister-lock/merely-neutral-silkworm branch March 17, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants