Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Fixes #988 - Plugins with multiple config policy nodes may cause a panic #989

Merged
merged 2 commits into from
Jun 17, 2016

Conversation

jcooklin
Copy link
Collaborator

@jcooklin jcooklin commented Jun 11, 2016

When there are multiple config policy nodes
and there exists a metric which does not fall under any of the policies
and the root node does not contain a policy

The following example causes a panic since no policies apply to /intel/abc/baz.
metric types
/intel/abc/foo
/intel/def/bar
/intel/abc/baz

config at
/intel/abc/foo
/intel/def/bar

root
/intel


  • @tiffanyfj to add test

c := New()
c.Add([]string{"intel", "foo", "sdi-x", "cody"}, d1)
c.Add([]string{"intel", "foo", "sdi-x", "nan"}, d2)
c.Freeze()
Copy link
Contributor

@IRCody IRCody Jun 16, 2016

Choose a reason for hiding this comment

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

I believe Get calls freeze for you on the first get so I'm not sure this is needed.

edit: Was thinking of the wrong tree. Disregard.

@IRCody
Copy link
Contributor

IRCody commented Jun 16, 2016

LGTM

@tiffanyfay tiffanyfay merged commit 6a8ba3a into intelsdi-x:master Jun 17, 2016
IRCody pushed a commit to IRCody/snap that referenced this pull request Jun 23, 2016
…cause a panic (intelsdi-x#989)

* Fixes intelsdi-x#988 - Plugins with multiple config policy nodes may cause a panic

* Test for intelsdi-x#988 - Plugins with multiple config policy nodes may cause a panic
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants