-
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
[Filebeat] Memory leak associated with failure to setup harvesters #6797
Comments
adriansr
added a commit
to adriansr/beats
that referenced
this issue
Apr 13, 2018
This patch reorganizes a little bit how the log harvester works, so that suboutlets are only created when the harvester is ready to use them (inside Run()), instead of being passed during constructor. This prevents a memory leak caused by some internal goroutines not stopping if the harvester Setup() fails, for example when files cannot be read. Fixes elastic#6797
urso
pushed a commit
that referenced
this issue
Apr 13, 2018
This patch reorganizes a little bit how the log harvester works, so that suboutlets are only created when the harvester is ready to use them (inside Run()), instead of being passed during constructor. This prevents a memory leak caused by some internal goroutines not stopping if the harvester Setup() fails, for example when files cannot be read. Fixes #6797
Fixed in #6829 (for master). |
adriansr
added a commit
to adriansr/beats
that referenced
this issue
May 18, 2018
This patch reorganizes a little bit how the log harvester works, so that suboutlets are only created when the harvester is ready to use them (inside Run()), instead of being passed during constructor. This prevents a memory leak caused by some internal goroutines not stopping if the harvester Setup() fails, for example when files cannot be read. Fixes elastic#6797
adriansr
added a commit
to adriansr/beats
that referenced
this issue
May 18, 2018
This patch reorganizes a little bit how the log harvester works, so that suboutlets are only created when the harvester is ready to use them (inside Run()), instead of being passed during constructor. This prevents a memory leak caused by some internal goroutines not stopping if the harvester Setup() fails, for example when files cannot be read. Fixes elastic#6797
ph
pushed a commit
that referenced
this issue
May 24, 2018
This patch reorganizes a little bit how the log harvester works, so that suboutlets are only created when the harvester is ready to use them (inside Run()), instead of being passed during constructor. This prevents a memory leak caused by some internal goroutines not stopping if the harvester Setup() fails, for example when files cannot be read. Fixes #6797
@andrewkroh is this already fixed in any stable release? |
This will be fixed in the 6.3.0 release and next 6.2.5, which should happen any day. |
mpfz0r
added a commit
to Graylog2/collector-sidecar
that referenced
this issue
Sep 21, 2018
Our bundled filebeat had a memory leak (elastic/beats#6797). Fixes #283 While here: The "-configtest" option is deprecated since Beats 6.0. Add a version switch to avoid warning.
mariussturm
pushed a commit
to Graylog2/collector-sidecar
that referenced
this issue
Oct 2, 2018
Our bundled filebeat had a memory leak (elastic/beats#6797). Fixes #283 While here: The "-configtest" option is deprecated since Beats 6.0. Add a version switch to avoid warning.
leweafan
pushed a commit
to leweafan/beats
that referenced
this issue
Apr 28, 2023
This patch reorganizes a little bit how the log harvester works, so that suboutlets are only created when the harvester is ready to use them (inside Run()), instead of being passed during constructor. This prevents a memory leak caused by some internal goroutines not stopping if the harvester Setup() fails, for example when files cannot be read. Fixes elastic#6797
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Filebeat has a memory leak which is exposed by repeated failure to setup harvesters (eg.
permission denied
). This ticket is a result of the original discussion on the community support site.From what I can tell, this comes down to channel.SubOutlet being created for the new harvester, but not cleaned up properly when
h.Setup()
throws an exception. I think this is because something that happens inharvester.Run()
is what actually cleans up the outlet. Another possibility is that the new harvester is getting added to a state or registry structure somewhere and forgotten, so garbage collection isn't reaping it.Here's some output from pprof. I've also attached the pprof file here.
Config (abridged):
Note, in the above scenario,
/var/log/auth.log
is the file which Filebeat can't access. We can, of course, fix the permissions to alleviate this problem, but that doesn't really fix anything.permission denied
error when opening the file.scan_frequency
(eg.1s
) will make it leak memory faster.Please let me know if there are more details I can provide, and I'm happy to test any potential solutions when we narrow down the problem.
Thanks,
Jeremy
The text was updated successfully, but these errors were encountered: