-
Notifications
You must be signed in to change notification settings - Fork 48
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
logstash-forwarder keep deleted files open #21
Comments
Facing the same issue,
Using LSF 0.4.0 |
@rahulghanate I think you're using logstash-forwarder, not logstash-forwarder-java. |
@ZhukovAlexey I'm surprised by your problem because I've been careful to track this kind of issues. Some of my instances have been running for months without any problem. It looks like you have a lot of file rotation, maybe this is the reason something is not running properly. Can you send a debug output, maybe it will help find a solution ? |
Yup, |
Hi, for me the same error. I suspect is related to use file match instead of wildcard. I mean my configuration is like
instead of
I've modified the FileWatcherTest.java to reproduce the error. As you can see in the second lsof looks like the file is not closed. /home/**/git/logstash-forwarder-java/testFileWatcher2.txt (deleted) I think is could be related to /src/main/java/info/fetter/logstashforwarder/FileWatcher.java In the line 162 =>
would not be?
|
@rbodoque you're right there's a problem with file match. I think it is located in the removeMarkedFilesFromWatchMap method :
Since a new file exists with the same name, the file descriptor is never closed. We'll have to find a way to detect it should be closed even if a new file exists. |
Yes, I'm using a wildcard
I've downloaded the new 0.2.4 version and it seems that bug is still here. 28099 is the forwarder's PID $/usr/local/bin/lsof -a +L1 /LOGS | grep -wc 28099 2016-08-31 16:25:28,949 INFO FileWatcher - File rename was detected: /LOGS/Application/LINK/Link/console.log.2 -> /LOGS/Application/LINK/Link/console.log.3 $/usr/local/bin/lsof -a +L1 /LOGS | grep -wc 28099 2016-08-31 16:26:52,008 INFO FileWatcher - File rename was detected: /LOGS/Application/LINK/Link2/console.log.1 -> /LOGS/Application/LINK/Link2/console.log.2 $/usr/local/bin/lsof -a +L1 /LOGS | grep -wc 28099 And after each rename operation the amount of open files keep growing, |
Here is the log with debug option. I hope this will help to determine the problem $/usr/local/bin/lsof -a +L1 /LOGS | grep -wc 21370 And there're 14 "File rename was detected" |
@ZhukovAlexey can you try with the fix I've just made in branch fix_issue_21 ? |
Yes, of course. Can you build a jar file with that fix? |
@didfet unfortunally it didn't help :( /usr/local/bin/lsof -a +L1 /LOGS | grep -wc 26157 Debug log: |
It seems that java version has the same bug elastic/logstash-forwarder#200
When a log file is rotated the logstash-forwarder agent keeps the deleted file opened until you kill its service.
This problem obviously causes an unhealthy situation of a consistently decreasing free space on the filesystem and currently my patch solution is scheduled restart for logstash-forwarder by a cron.
$ps -ef | grep forwarder | grep -v grep
wasadm 5981 1 0 Apr 6 ? 177:33 /IBM/WebSphere/AppServer/java/bin/IA64N/java -jar logstash-forwarder-java-0.2.3.jar -config config/ibm-was-system-logs-forwarde
wasadm 24530 1 31 Apr 26 ? 563:04 /IBM/WebSphere/AppServer/java/bin/IA64N/java -jar logstash-forwarder-java-0.2.3.jar -config config/app-albo-logs-forwarder.conf
$/usr/local/bin/lsof -a +L1 /LOGS | grep -wc 5981
1818
$/usr/local/bin/lsof -a +L1 /LOGS | grep -wc 24530
1022
The text was updated successfully, but these errors were encountered: