Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Fix bug where meta policy engine would not process job updates. #16

Merged
merged 3 commits into from
Aug 1, 2019

Conversation

jrasell
Copy link
Owner

@jrasell jrasell commented Jul 24, 2019

The meta policy watcher was doing an incorrect comparison when
checking whether the modify index on a job specification returned
from the API. Previously it was comparing against the maxfound
which was being set to the Jobs().List() returned meta. This meant
the job modify index would always be <= as it could never be
greater than the value of the API returned meta index.

In addition to fixing the above mentioned bug; this commit adds
some contextual logging around the meta watcher to help identify
any future issues and make operating in this mode easier.

Closes #15

The meta policy watcher was doing an incorrect comparison when
checking whether the modify index on a job specification returned
from the API. Previously it was comparing against the maxfound
which was being set to the Jobs().List() returned meta. This meant
the job modify index would always be <= as it could never be
greater than the value of the API returned meta index.

In addition to fixing the above mentioned bug; this commit adds
some contextual logging around the meta watcher to help identify
any future issues and make operating in this mode easier.

Closes #15
@jrasell jrasell added kind/bug Issues relating to bugs area/policy-engine Issues related to the policy engine labels Jul 24, 2019
@jrasell jrasell self-assigned this Jul 24, 2019
Copy link
Contributor

@jvineet jvineet left a comment

Choose a reason for hiding this comment

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

Couple of comments.

Also looks like we can move the var maxFound uint64
to be declared outside the for loop in the Run() function

@jrasell wondering if my comments make sense or not.

pkg/policy/watcher/watcher.go Outdated Show resolved Hide resolved
pkg/policy/watcher/watcher.go Outdated Show resolved Hide resolved
pkg/policy/watcher/watcher.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jvineet jvineet left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks @jrasell

@jrasell jrasell changed the title Fix bug here meta policy engine would not process job updates. Fix bug where meta policy engine would not process job updates. Aug 1, 2019
@jrasell jrasell merged commit 6b2a930 into master Aug 1, 2019
@jrasell jrasell deleted the gh-15 branch August 1, 2019 07:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/policy-engine Issues related to the policy engine kind/bug Issues relating to bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The nomad-meta-policy-engine is unable to load the policy tags from the job group meta stanza
2 participants