{"action":"created","comment":{"url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/comments/48283929","id":48283929,"diff_hunk":"@@ -199,63 +184,101 @@\n     end\n   end\n \n-  context \"when #run is called multiple times\", :unix => true do\n+  context \"when close_older config is specified\" do\n     let(:tmpdir_path)  { Stud::Temporary.directory }\n     let(:sincedb_path) { Stud::Temporary.pathname }\n-    let(:file_path)    { \"#{tmpdir_path}/a.log\" }\n-    let(:buffer)       { [] }\n-    let(:lsof)         { [] }\n-    let(:stop_proc) do\n-      lambda do |input, arr|\n-        Thread.new(input, arr) do |i, a|\n-          sleep 0.5\n-          a << `lsof -p #{Process.pid} | grep \"a.log\"`\n-          i.stop\n-        end\n+    let(:conf)         { Hash.new }\n+    let(:events)       { [] }\n+    let(:codec)        { CodecTracer.new }\n+    let(:line)         { \"line1.1-of-a\" }\n+\n+    subject { described_class.new(conf) }\n+\n+    before do\n+      conf.update(\n+            \"type\" => \"blah\",\n+            \"path\" => \"#{tmpdir_path}/*.log\",\n+            \"sincedb_path\" => sincedb_path,\n+            \"stat_interval\" => 0.02,\n+            \"codec\" => codec,\n+            \"close_older\" => 2,\n+            \"delimiter\" => FILE_DELIMITER)\n+\n+      subject.register\n+      Thread.new { subject.run(events) }\n+    end\n+\n+    it \"having timed_out, the identity is evicted\" do\n+      sleep 0.1\n+      File.open(\"#{tmpdir_path}/a.log\", \"a\") do |fd|\n+        fd.puts(line)\n       end\n+      sleep 1\n+      expect(codec).to receive_call_and_args(:accept, [true])\n+      expect(subject.codec.identity_count).to eq(1)\n+      sleep 3 # gotta wait for expiry to kick in and close files.\n+      subject.stop","path":"spec/inputs/file_spec.rb","position":171,"original_position":171,"commit_id":"65fc77656c944522d433dcbd345ddcaa058f299f","original_commit_id":"65fc77656c944522d433dcbd345ddcaa058f299f","user":{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false},"body":"should the stop be done after the expectation? The stop close the filewatch no? I am a bit confused.","created_at":"2015-12-22T18:44:07Z","updated_at":"2015-12-22T18:44:07Z","html_url":"https://github.com/logstash-plugins/logstash-input-file/pull/87#discussion_r48283929","pull_request_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/comments/48283929"},"html":{"href":"https://github.com/logstash-plugins/logstash-input-file/pull/87#discussion_r48283929"},"pull_request":{"href":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/87","id":54277839,"html_url":"https://github.com/logstash-plugins/logstash-input-file/pull/87","diff_url":"https://github.com/logstash-plugins/logstash-input-file/pull/87.diff","patch_url":"https://github.com/logstash-plugins/logstash-input-file/pull/87.patch","issue_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/issues/87","number":87,"state":"open","locked":false,"title":"Add config option for ignore_after","user":{"login":"guyboertje","id":84912,"avatar_url":"https://avatars.githubusercontent.com/u/84912?v=3","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"body":"NOTES FOR REVIEWERS:\r\n- This builds on changes in filewatch v0.6.8 (unpublished as yet)\r\n- This builds on changes in the multiline codec v2.0.5 (unpublished as yet)\r\n- Logic: filewatch knowing about `ignore_after`, calls `timed_out` on a file input listener which calls `evict(path)` on the identity_map_codec which calls `auto_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 the `auto_flush interval` is less than the `ignore_after interval`.","created_at":"2015-12-21T16:50:51Z","updated_at":"2015-12-22T18:44:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"215372b80be375d32c00ae4be726f92aa053d27a","assignee":{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/87/commits","review_comments_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/87/comments","review_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/comments{/number}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/issues/87/comments","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/statuses/65fc77656c944522d433dcbd345ddcaa058f299f","head":{"label":"guyboertje:feature/ignore_after","ref":"feature/ignore_after","sha":"65fc77656c944522d433dcbd345ddcaa058f299f","user":{"login":"guyboertje","id":84912,"avatar_url":"https://avatars.githubusercontent.com/u/84912?v=3","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"repo":{"id":38876393,"name":"logstash-input-file","full_name":"guyboertje/logstash-input-file","owner":{"login":"guyboertje","id":84912,"avatar_url":"https://avatars.githubusercontent.com/u/84912?v=3","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guyboertje/logstash-input-file","description":null,"fork":true,"url":"https://api.github.com/repos/guyboertje/logstash-input-file","forks_url":"https://api.github.com/repos/guyboertje/logstash-input-file/forks","keys_url":"https://api.github.com/repos/guyboertje/logstash-input-file/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guyboertje/logstash-input-file/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guyboertje/logstash-input-file/teams","hooks_url":"https://api.github.com/repos/guyboertje/logstash-input-file/hooks","issue_events_url":"https://api.github.com/repos/guyboertje/logstash-input-file/issues/events{/number}","events_url":"https://api.github.com/repos/guyboertje/logstash-input-file/events","assignees_url":"https://api.github.com/repos/guyboertje/logstash-input-file/assignees{/user}","branches_url":"https://api.github.com/repos/guyboertje/logstash-input-file/branches{/branch}","tags_url":"https://api.github.com/repos/guyboertje/logstash-input-file/tags","blobs_url":"https://api.github.com/repos/guyboertje/logstash-input-file/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guyboertje/logstash-input-file/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guyboertje/logstash-input-file/git/refs{/sha}","trees_url":"https://api.github.com/repos/guyboertje/logstash-input-file/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guyboertje/logstash-input-file/statuses/{sha}","languages_url":"https://api.github.com/repos/guyboertje/logstash-input-file/languages","stargazers_url":"https://api.github.com/repos/guyboertje/logstash-input-file/stargazers","contributors_url":"https://api.github.com/repos/guyboertje/logstash-input-file/contributors","subscribers_url":"https://api.github.com/repos/guyboertje/logstash-input-file/subscribers","subscription_url":"https://api.github.com/repos/guyboertje/logstash-input-file/subscription","commits_url":"https://api.github.com/repos/guyboertje/logstash-input-file/commits{/sha}","git_commits_url":"https://api.github.com/repos/guyboertje/logstash-input-file/git/commits{/sha}","comments_url":"https://api.github.com/repos/guyboertje/logstash-input-file/comments{/number}","issue_comment_url":"https://api.github.com/repos/guyboertje/logstash-input-file/issues/comments{/number}","contents_url":"https://api.github.com/repos/guyboertje/logstash-input-file/contents/{+path}","compare_url":"https://api.github.com/repos/guyboertje/logstash-input-file/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guyboertje/logstash-input-file/merges","archive_url":"https://api.github.com/repos/guyboertje/logstash-input-file/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guyboertje/logstash-input-file/downloads","issues_url":"https://api.github.com/repos/guyboertje/logstash-input-file/issues{/number}","pulls_url":"https://api.github.com/repos/guyboertje/logstash-input-file/pulls{/number}","milestones_url":"https://api.github.com/repos/guyboertje/logstash-input-file/milestones{/number}","notifications_url":"https://api.github.com/repos/guyboertje/logstash-input-file/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guyboertje/logstash-input-file/labels{/name}","releases_url":"https://api.github.com/repos/guyboertje/logstash-input-file/releases{/id}","created_at":"2015-07-10T11:06:40Z","updated_at":"2015-07-10T11:06:40Z","pushed_at":"2015-12-22T16:59:01Z","git_url":"git://github.com/guyboertje/logstash-input-file.git","ssh_url":"git@github.com:guyboertje/logstash-input-file.git","clone_url":"https://github.com/guyboertje/logstash-input-file.git","svn_url":"https://github.com/guyboertje/logstash-input-file","homepage":null,"size":79,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"logstash-plugins:master","ref":"master","sha":"4ebc77b1aa5a1a84dd6fe357be35e55015d46c47","user":{"login":"logstash-plugins","id":8961934,"avatar_url":"https://avatars.githubusercontent.com/u/8961934?v=3","gravatar_id":"","url":"https://api.github.com/users/logstash-plugins","html_url":"https://github.com/logstash-plugins","followers_url":"https://api.github.com/users/logstash-plugins/followers","following_url":"https://api.github.com/users/logstash-plugins/following{/other_user}","gists_url":"https://api.github.com/users/logstash-plugins/gists{/gist_id}","starred_url":"https://api.github.com/users/logstash-plugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logstash-plugins/subscriptions","organizations_url":"https://api.github.com/users/logstash-plugins/orgs","repos_url":"https://api.github.com/users/logstash-plugins/repos","events_url":"https://api.github.com/users/logstash-plugins/events{/privacy}","received_events_url":"https://api.github.com/users/logstash-plugins/received_events","type":"Organization","site_admin":false},"repo":{"id":25312459,"name":"logstash-input-file","full_name":"logstash-plugins/logstash-input-file","owner":{"login":"logstash-plugins","id":8961934,"avatar_url":"https://avatars.githubusercontent.com/u/8961934?v=3","gravatar_id":"","url":"https://api.github.com/users/logstash-plugins","html_url":"https://github.com/logstash-plugins","followers_url":"https://api.github.com/users/logstash-plugins/followers","following_url":"https://api.github.com/users/logstash-plugins/following{/other_user}","gists_url":"https://api.github.com/users/logstash-plugins/gists{/gist_id}","starred_url":"https://api.github.com/users/logstash-plugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logstash-plugins/subscriptions","organizations_url":"https://api.github.com/users/logstash-plugins/orgs","repos_url":"https://api.github.com/users/logstash-plugins/repos","events_url":"https://api.github.com/users/logstash-plugins/events{/privacy}","received_events_url":"https://api.github.com/users/logstash-plugins/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/logstash-plugins/logstash-input-file","description":null,"fork":false,"url":"https://api.github.com/repos/logstash-plugins/logstash-input-file","forks_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/forks","keys_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/keys{/key_id}","collaborators_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/teams","hooks_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/hooks","issue_events_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/issues/events{/number}","events_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/events","assignees_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/assignees{/user}","branches_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/branches{/branch}","tags_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/tags","blobs_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/git/refs{/sha}","trees_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/git/trees{/sha}","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/statuses/{sha}","languages_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/languages","stargazers_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/stargazers","contributors_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/contributors","subscribers_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/subscribers","subscription_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/subscription","commits_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/commits{/sha}","git_commits_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/git/commits{/sha}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/comments{/number}","issue_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/issues/comments{/number}","contents_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/contents/{+path}","compare_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/compare/{base}...{head}","merges_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/merges","archive_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/downloads","issues_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/issues{/number}","pulls_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls{/number}","milestones_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/milestones{/number}","notifications_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/labels{/name}","releases_url":"https://api.github.com/repos/logstash-plugins/logstash-input-file/releases{/id}","created_at":"2014-10-16T17:03:03Z","updated_at":"2015-11-30T21:55:17Z","pushed_at":"2015-12-22T16:59:02Z","git_url":"git://github.com/logstash-plugins/logstash-input-file.git","ssh_url":"git@github.com:logstash-plugins/logstash-input-file.git","clone_url":"https://github.com/logstash-plugins/logstash-input-file.git","svn_url":"https://github.com/logstash-plugins/logstash-input-file","homepage":null,"size":66,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":47,"forks":24,"open_issues":47,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/87"},"html":{"href":"https://github.com/logstash-plugins/logstash-input-file/pull/87"},"issue":{"href":"https://api.github.com/repos/logstash-plugins/logstash-input-file/issues/87"},"comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-input-file/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/logstash-plugins/logstash-input-file/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/logstash-plugins/logstash-input-file/statuses/65fc77656c944522d433dcbd345ddcaa058f299f"}}}}