-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add config option for ignore_after #87
Add config option for ignore_after #87
Conversation
# set the mode, defaults to "tail" | ||
# in read_to_eof mode filewatch will signal the EOF with a "\x04" control character | ||
# in tail mode behaviour is as before | ||
config :ignore_after, :validate => :number, :default => 24 * 60 * 60 |
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.
Filebeat calls this ignore_older
. We talked about being consistent with filebeat to aid any migration to and from these components.
Also, can we add a more descriptive message (copied from filebeat) -
"If this option is specified, file input ignores any files that were modified before the specified timespan in milliseconds. This timeout also triggers a release of resources obtained"
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.
sure, the comment needs to change.
but I spoke to Tudor and they are having real issues with the name and the two functions controlled by one option thing - I asked him to comment on our issue, he did: #81 (comment)
Jenkins please test this |
@@ -1,7 +1,7 @@ | |||
Gem::Specification.new do |s| | |||
|
|||
s.name = 'logstash-input-file' | |||
s.version = '2.0.3' | |||
s.version = '2.0.4' |
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.
Lets make it 2.1.0. This is new functionality being added
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.
+1
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.
Noted
This PR doesn't have an update to the changelog. |
stop # if the pipeline restarts this input. | ||
@tail = FileWatch::Tail.new(@tail_config) | ||
# if the pipeline restarts this input. | ||
stop |
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.
The stop here is to close unwanted open fd so we don't leak them?
Might be good to add comment why we actually call stop here.
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.
Will expand comment
jenkins test this please |
I did a review of the code, added a few comments. Also the test are passing locally but not on jenkins. I have modified the jenkins job to clear the workspace before running any test. Without that option we can have cached/incompatible version of the gem available. I also did a really minimal test of the file input and it look good! |
@guyboertje I was looking the the jenkins jobs that test all the plugins and I have found this problem. I think this PR also fix this issue?
|
Jenkins jobs should work now. All waits are dependent on state change occurring before continue and not guess-work sleeps. |
@jsvd I agree with your comment, but I suggest we create a specific issue for it. this would also allow us to remove the last pieces of insists. |
code LGTM but lets refactor the test in another run? |
+1 on refactoring tests later. Thanks guys. |
begin to add ignore_after config option depends on filewatch 0.6.8 add timed_out method to TailListener and specs revert Gemfile changes for PR split and rename ignore_after option, update gem deps to published ver. bump ver, make suggested review changes and improve spec reliability update changelog Fixes logstash-plugins#81, Fixes logstash-plugins#89, Fixes logstash-plugins#90
c7f0cb8
to
9d83422
Compare
Guy Boertje merged this into the following branches!
|
# was last modified before the specified timespan in seconds, the file is | ||
# ignored. After it's discovery, if an ignored file is modified it is no | ||
# longer ignored and any new data is read. The default is 24 hours. | ||
config :ignore_older, :validate => :number, :default => 24 * 60 * 60 |
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.
@guyboertje I'm currently adding the close_older function also the filebeat. As we have now ignore_older and close_older, I suggest to set ignore_older to at least 72 hours or even "infinite" by default. The reasoning behind this is that we had some edge cases in the past. Any thoughts? https://github.com/elastic/filebeat/issues/181
NOTES FOR REVIEWERS:
close_older
, callstimed_out
on a file input listener which callsevict(path)
on the identity_map_codec which callsauto_flush
on the multiline codec and also evicts the identity from the map. Auto_flush should have already assembled and sent the event from any buffered lines if theauto_flush interval
is less than theclose_older interval
.