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

Remove runner creation from every reload check #5141

Merged
merged 1 commit into from
Sep 12, 2017

Conversation

vjsamuel
Copy link
Contributor

@vjsamuel vjsamuel commented Sep 9, 2017

This PR will partly mitigate #5139 as it removes runner creation during every reload interval.

@elasticmachine
Copy link
Collaborator

Can one of the admins verify this patch?

@vjsamuel vjsamuel force-pushed the remove_runner_creation branch from 6b7adec to 96763f4 Compare September 9, 2017 06:23
@ruflin
Copy link
Member

ruflin commented Sep 11, 2017

Travis build failure should be solved by: #5142

@exekias exekias added Filebeat Filebeat Metricbeat Metricbeat bug needs_backport PR is waiting to be backported to other branches. review labels Sep 11, 2017
Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @vjsamuel! 🎉

LGTM, I think we should get rid of Runner.ID() method to avoid inconsistencies.

Also, want to hear from @urso as he was involved in this

Copy link
Member

@ruflin ruflin left a 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{}{}
Copy link
Member

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.

Copy link
Contributor Author

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>

@ruflin
Copy link
Member

ruflin commented Sep 11, 2017

BTW: If we can remove the ID method 👍 from my side. I think also @urso did not like it when I introduced it but we didn't have a better way. That is why I worry the above breaks things.

@vjsamuel
Copy link
Contributor Author

@ruflin should ID() be removed in the same PR or a subsequent one?

@ruflin
Copy link
Member

ruflin commented Sep 11, 2017

In case ID() is not used anywhere else it would be nice to directly remove it here to make sure we don't forget it. Could you rebase your PR on master because there was a build issue earlier today which is fixed now.

@vjsamuel vjsamuel force-pushed the remove_runner_creation branch from 96763f4 to 385c4f2 Compare September 11, 2017 18:22
@vjsamuel
Copy link
Contributor Author

@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.

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

WFG

@exekias
Copy link
Contributor

exekias commented Sep 11, 2017

ok to test

@ruflin ruflin merged commit b247e88 into elastic:master Sep 12, 2017
@vjsamuel vjsamuel deleted the remove_runner_creation branch September 12, 2017 05:12
exekias pushed a commit to exekias/beats that referenced this pull request Sep 12, 2017
@exekias exekias removed the needs_backport PR is waiting to be backported to other branches. label Sep 12, 2017
tsg pushed a commit that referenced this pull request Sep 12, 2017
@andrewkroh
Copy link
Member

@ruflin
Copy link
Member

ruflin commented Nov 26, 2017

@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.

leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants