{"action":"created","issue":{"url":"https://api.github.com/repos/docker/swarm/issues/2567","repository_url":"https://api.github.com/repos/docker/swarm","labels_url":"https://api.github.com/repos/docker/swarm/issues/2567/labels{/name}","comments_url":"https://api.github.com/repos/docker/swarm/issues/2567/comments","events_url":"https://api.github.com/repos/docker/swarm/issues/2567/events","html_url":"https://github.com/docker/swarm/issues/2567","id":194973356,"number":2567,"title":"Container logs file remains open","user":{"login":"evoevodin","id":4053805,"avatar_url":"https://avatars.githubusercontent.com/u/4053805?v=3","gravatar_id":"","url":"https://api.github.com/users/evoevodin","html_url":"https://github.com/evoevodin","followers_url":"https://api.github.com/users/evoevodin/followers","following_url":"https://api.github.com/users/evoevodin/following{/other_user}","gists_url":"https://api.github.com/users/evoevodin/gists{/gist_id}","starred_url":"https://api.github.com/users/evoevodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoevodin/subscriptions","organizations_url":"https://api.github.com/users/evoevodin/orgs","repos_url":"https://api.github.com/users/evoevodin/repos","events_url":"https://api.github.com/users/evoevodin/events{/privacy}","received_events_url":"https://api.github.com/users/evoevodin/received_events","type":"User","site_admin":false},"labels":[{"id":96571876,"url":"https://api.github.com/repos/docker/swarm/labels/kind/bug","name":"kind/bug","color":"207de5","default":false},{"id":211244097,"url":"https://api.github.com/repos/docker/swarm/labels/priority/P1","name":"priority/P1","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/docker/swarm/milestones/16","html_url":"https://github.com/docker/swarm/milestone/16","labels_url":"https://api.github.com/repos/docker/swarm/milestones/16/labels","id":1937879,"number":16,"title":"1.2.6","description":"","creator":{"login":"dongluochen","id":14985073,"avatar_url":"https://avatars.githubusercontent.com/u/14985073?v=3","gravatar_id":"","url":"https://api.github.com/users/dongluochen","html_url":"https://github.com/dongluochen","followers_url":"https://api.github.com/users/dongluochen/followers","following_url":"https://api.github.com/users/dongluochen/following{/other_user}","gists_url":"https://api.github.com/users/dongluochen/gists{/gist_id}","starred_url":"https://api.github.com/users/dongluochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongluochen/subscriptions","organizations_url":"https://api.github.com/users/dongluochen/orgs","repos_url":"https://api.github.com/users/dongluochen/repos","events_url":"https://api.github.com/users/dongluochen/events{/privacy}","received_events_url":"https://api.github.com/users/dongluochen/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":13,"state":"open","created_at":"2016-08-11T21:13:12Z","updated_at":"2016-12-21T21:54:54Z","due_on":"2017-01-10T08:00:00Z","closed_at":null},"comments":3,"created_at":"2016-12-12T13:24:18Z","updated_at":"2016-12-26T09:01:16Z","closed_at":null,"body":"Hi there :hand:\r\n\r\nWhen i make the following request:\r\n\r\n```bash\r\ncurl \"http://0.0.0.0:23750/containers/<container-id>/logs?stdout=1&stderr=1&follow=1\" --max-time 5\r\n```\r\n0.0.0.0:23750 <- swarm\r\n\r\ncontainer logs file on node is opened 1 more time, but when timeout is reached\r\nand connection becomes closed - the file remains open.\r\nI tried different request configurations and got the following results:\r\n\r\n- :no_entry_sign: - file remains open\r\n- :ok_hand: - file is closed after some period of time\r\n\r\n| curl params                        | follow=    | swarm           | direct daemon request |\r\n| ------------------:                |-----------:| ---------------:|----------------------:|\r\n| --max-time=5                       | true       | :no_entry_sign: |   :ok_hand:           |\r\n| --max-time=5                       | false      | :ok_hand:       |   :ok_hand:           |\r\n|                                    | false      | :ok_hand:       |   :ok_hand:           |\r\n| --no-keepalive --max-time=5        | true       | :no_entry_sign: |   :ok_hand:           |\r\n\r\nI used the following command to check open files:\r\n\r\n```bash\r\nlsof -p $(cat /run/docker.pid) | awk '{print $9 $10}' | sort | uniq -c | sort -n | grep \".*containers.*log\"\r\n```\r\n\r\nit produces something like this:\r\n```\r\n1   /var/lib/docker/containers/94e48934b97db014dd9e0b89cca84e4bb332c5101e239644ba5aa19f276ea13e/94e48934b97db014dd9e0b89cca84e4bb332c5101e239644ba5aa19f276ea13e-json.log\r\n885 /var/lib/docker/containers/eacc357e0724eb1f64781e9fb5ce202e282db4e875b10a4479d3c3bf103f8934/eacc357e0724eb1f64781e9fb5ce202e282db4e875b10a4479d3c3bf103f8934-json.log\r\n```\r\nwhere the first column is a number of openings for a certain file.\r\n\r\n\r\n##### Versions:\r\n\r\n```\r\n# docker version\r\nClient:\r\n Version:      1.11.1\r\n API version:  1.23\r\n Go version:   go1.5.4\r\n Git commit:   5604cbe\r\n Built:        Wed Apr 27 00:34:42 2016\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      1.11.1\r\n API version:  1.23\r\n Go version:   go1.5.4\r\n Git commit:   5604cbe\r\n Built:        Wed Apr 27 00:34:42 2016\r\n OS/Arch:      linux/amd64\r\n```\r\n\r\n\r\n```\r\n#swarm --version\r\nswarm version 1.2.3 (eaa53c7)\r\n```\r\n\r\n```\r\n#cat /etc/redhat-release\r\nCentOS Linux release 7.2.1511 (Core) \r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/docker/swarm/issues/comments/269187197","html_url":"https://github.com/docker/swarm/issues/2567#issuecomment-269187197","issue_url":"https://api.github.com/repos/docker/swarm/issues/2567","id":269187197,"user":{"login":"evoevodin","id":4053805,"avatar_url":"https://avatars.githubusercontent.com/u/4053805?v=3","gravatar_id":"","url":"https://api.github.com/users/evoevodin","html_url":"https://github.com/evoevodin","followers_url":"https://api.github.com/users/evoevodin/followers","following_url":"https://api.github.com/users/evoevodin/following{/other_user}","gists_url":"https://api.github.com/users/evoevodin/gists{/gist_id}","starred_url":"https://api.github.com/users/evoevodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoevodin/subscriptions","organizations_url":"https://api.github.com/users/evoevodin/orgs","repos_url":"https://api.github.com/users/evoevodin/repos","events_url":"https://api.github.com/users/evoevodin/events{/privacy}","received_events_url":"https://api.github.com/users/evoevodin/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T09:01:16Z","updated_at":"2016-12-26T09:01:16Z","body":"Hi @dongluochen,\r\n\r\n> @evoevodin In my test, when curl finishes, the extra file handle on the target node log file remains open for 15 seconds. After 15 seconds the handle closes. Can you confirm if this is the case?\r\n\r\nI checked it again, when i use swarm - logs file remains open even after ~2h.\r\nWhen i use node docker daemon directly file is closed immediately or after small amount of time.\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"evoevodin"}}