-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Remove runner creation from every reload check #5141
Conversation
Can one of the admins verify this patch? |
6b7adec
to
96763f4
Compare
Travis build failure should be solved by: #5142 |
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.
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.
Left one comment as I remember there was a reason for the ID()
. Good thing is that all tests seem to pass :-)
It seems this would only mitigate the memory issue, so really keen on figuring out what the actual issue is too.
@@ -174,29 +175,34 @@ func (rl *Reloader) Run(runnerFactory RunnerFactory) { | |||
continue | |||
} | |||
|
|||
runner, err := runnerFactory.Create(c) | |||
rawCfg := map[string]interface{}{} |
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.
Not 100% sure anymore, but I think there is a difference between this and ID()
. In the case of ID()
the following to configs are the same:
a: b
c: d
and
c: d
a: b
That means the order does not matter, but with the above it does. But not 100% sure anymore if that was the reason I ended up with ID()
but there was an issue.
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.
func main () {
a := map[string]interface{}{
"a": "b",
"c": "d",
}
b := map[string]interface{}{
"c": "d",
"a": "b",
}
fmt.Println(hashstructure.Hash(a, nil))
fmt.Println(hashstructure.Hash(b, nil))
}
output:
8710980024335696864 <nil>
8710980024335696864 <nil>
BTW: If we can remove the |
@ruflin should |
In case |
96763f4
to
385c4f2
Compare
@ruflin i will file a subsequent PR immediately later in the day to remove ID. i have to fix collectbeat as well. if you dont mind, i will create an issue and track it against me so that it is definitely taken care. |
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.
WFG
ok to test |
(cherry picked from commit b247e88)
@ruflin @exekias Do we need to backport this to 5.6? Asking b/c of https://discuss.elastic.co/t/metricbeat-mongodb-leaks-connections-when-metricbeat-config-modules-reload-enabled-set-to-true/108723?u=andrewkroh |
@andrewkroh I think we could backport it, but as reloading was beta in 5.6 and is that 6.0 is out with the fix, I would rather encourage people to upgrade. |
This PR will partly mitigate #5139 as it removes runner creation during every reload interval.