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

goroutine leak in template runner #20163

Closed
tgross opened this issue Mar 19, 2024 · 1 comment · Fixed by #20234
Closed

goroutine leak in template runner #20163

tgross opened this issue Mar 19, 2024 · 1 comment · Fixed by #20234

Comments

@tgross
Copy link
Member

tgross commented Mar 19, 2024

A Nomad user reported an issue where template runner View.poll goroutines were being leaked when using templates with many dependencies.

An investigation found that when the runner's Run method is in-flight and the runner concurrently receives Stop, it's possible for the watcher to stop dependencies via stop and then immediately recreate them. Because the Stop method has returned, Nomad's template hook will assume that all goroutines have been stopped, and this causes the View.poll goroutines to be leaked. The race condition for this case is very narrow, but is most likely to occur when the user has both a very large number of dependencies, short secret leases, and the template Wait configuration is nil.

I've got a PR fixing this in hashicorp/consul-template#1898. Once that's been merged and released, we'll need to bump the dependency in Nomad. Looking to ship this fix in the next patch version of Nomad, as well as backports.

@tgross
Copy link
Member Author

tgross commented Mar 22, 2024

hashicorp/consul-template#1898 has been merged and we've sent a build to the folks who reported it so they can confirm it entirely fixes the issue. Once that's been done we'll get that dependency bump shipped here.

tgross added a commit that referenced this issue Mar 27, 2024
A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163
tgross added a commit that referenced this issue Mar 27, 2024
A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163
tgross added a commit that referenced this issue Mar 27, 2024
A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163
@tgross tgross closed this as completed in c3e7b13 Mar 27, 2024
tgross added a commit that referenced this issue Mar 27, 2024
A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163
tgross added a commit that referenced this issue Mar 27, 2024
A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163
tgross added a commit that referenced this issue Mar 27, 2024
A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163
tgross added a commit that referenced this issue Mar 27, 2024
A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163
tgross added a commit that referenced this issue Mar 27, 2024
…ak into release/1.6.x (#20237)

A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163

Co-authored-by: Tim Gross <tgross@hashicorp.com>
tgross added a commit that referenced this issue Mar 27, 2024
…ak into release/1.5.x (#20236)

A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163

Co-authored-by: Tim Gross <tgross@hashicorp.com>
philrenaud pushed a commit that referenced this issue Apr 18, 2024
A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: #20163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant