{"action":"created","issue":{"url":"https://api.github.com/repos/3Hren/blackhole/issues/58","labels_url":"https://api.github.com/repos/3Hren/blackhole/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/3Hren/blackhole/issues/58/comments","events_url":"https://api.github.com/repos/3Hren/blackhole/issues/58/events","html_url":"https://github.com/3Hren/blackhole/issues/58","id":97575652,"number":58,"title":"files sink doesn't always rotate logs","user":{"login":"bioothod","id":1847575,"avatar_url":"https://avatars.githubusercontent.com/u/1847575?v=3","gravatar_id":"","url":"https://api.github.com/users/bioothod","html_url":"https://github.com/bioothod","followers_url":"https://api.github.com/users/bioothod/followers","following_url":"https://api.github.com/users/bioothod/following{/other_user}","gists_url":"https://api.github.com/users/bioothod/gists{/gist_id}","starred_url":"https://api.github.com/users/bioothod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bioothod/subscriptions","organizations_url":"https://api.github.com/users/bioothod/orgs","repos_url":"https://api.github.com/users/bioothod/repos","events_url":"https://api.github.com/users/bioothod/events{/privacy}","received_events_url":"https://api.github.com/users/bioothod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-27T23:02:43Z","updated_at":"2015-07-28T07:02:20Z","closed_at":null,"body":"We frequently see this issue in elliptics:\r\n\r\n`# ls -l /proc/19808/fd/ | grep log\r\nl-wx------ 1 root root 64 Jul 28 01:49 3 -> /home/admin/elliptics/log/ioserv.log-2015.07.22-1437535502 (deleted)\r\n`\r\n\r\nioserv.log - elliptics log file - was moved by logrotate 6 days ago, but blackhole didn't notice that and didn't reopen logfile.\r\nHere is appropriate config section:\r\n```javascript\r\n        \"logger\": {\r\n                \"frontends\": [\r\n                        {\r\n                                \"formatter\": {\r\n                                        \"type\": \"string\",\r\n                                        \"pattern\": \"%(timestamp)s %(request_id)s/%(lwp)s/%(pid)s %(severity)s: %(message)s %(...L)s\"\r\n                                },\r\n                                \"sink\": {\r\n                                        \"type\": \"files\",\r\n                                        \"path\": \"/home/admin/elliptics/log/ioserv.log\",\r\n                                        \"autoflush\": true,\r\n                                        \"rotation\": {\r\n                                                \"move\": 0\r\n                                        }\r\n                                }\r\n                        }\r\n                ],\r\n                \"level\": \"info\"\r\n        },\r\n```\r\n\r\nWe use blackhole 0.2 if that matters. Rotation changed a little bit - there were introduced additional checks which might explain why 'size' rotation doesn't work in 0.2, but common 'move' logic is the same afaics.\r\n\r\nIt doesn't happen all the time, but yet quite frequently."},"comment":{"url":"https://api.github.com/repos/3Hren/blackhole/issues/comments/125476736","html_url":"https://github.com/3Hren/blackhole/issues/58#issuecomment-125476736","issue_url":"https://api.github.com/repos/3Hren/blackhole/issues/58","id":125476736,"user":{"login":"3Hren","id":969900,"avatar_url":"https://avatars.githubusercontent.com/u/969900?v=3","gravatar_id":"","url":"https://api.github.com/users/3Hren","html_url":"https://github.com/3Hren","followers_url":"https://api.github.com/users/3Hren/followers","following_url":"https://api.github.com/users/3Hren/following{/other_user}","gists_url":"https://api.github.com/users/3Hren/gists{/gist_id}","starred_url":"https://api.github.com/users/3Hren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3Hren/subscriptions","organizations_url":"https://api.github.com/users/3Hren/orgs","repos_url":"https://api.github.com/users/3Hren/repos","events_url":"https://api.github.com/users/3Hren/events{/privacy}","received_events_url":"https://api.github.com/users/3Hren/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T07:02:20Z","updated_at":"2015-07-28T07:02:20Z","body":"It can happen, when someone has renamed the file and reopened it before Blackhole attempted to write into. \r\nPossibly logrotate can, check its config please.\r\n\r\nHowever the current check-condition logic is buggy and is subject to change."}}