{"action":"opened","issue":{"url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1462","repository_url":"https://api.github.com/repos/rejectedsoftware/vibe.d","labels_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1462/labels{/name}","comments_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1462/comments","events_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1462/events","html_url":"https://github.com/rejectedsoftware/vibe.d/issues/1462","id":144188875,"number":1462,"title":"File descriptors leak","user":{"login":"yazd","id":1556354,"avatar_url":"https://avatars.githubusercontent.com/u/1556354?v=3","gravatar_id":"","url":"https://api.github.com/users/yazd","html_url":"https://github.com/yazd","followers_url":"https://api.github.com/users/yazd/followers","following_url":"https://api.github.com/users/yazd/following{/other_user}","gists_url":"https://api.github.com/users/yazd/gists{/gist_id}","starred_url":"https://api.github.com/users/yazd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yazd/subscriptions","organizations_url":"https://api.github.com/users/yazd/orgs","repos_url":"https://api.github.com/users/yazd/repos","events_url":"https://api.github.com/users/yazd/events{/privacy}","received_events_url":"https://api.github.com/users/yazd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-29T08:04:49Z","updated_at":"2016-03-29T08:04:49Z","closed_at":null,"body":"The following program leaks file descriptors just by importing `vibe.core.core`. Removing the import results in a constant number of file descriptors: 4.\r\n\r\n```\r\nimport std.stdio;\r\nimport std.parallelism;\r\nimport std.range;\r\nimport std.algorithm;\r\nimport std.file;\r\n\r\nimport vibe.core.core;\r\n\r\nvoid main()\r\n{\r\n    writeln(__VERSION__);\r\n\r\n    foreach (i; 0 .. 10)\r\n    {\r\n        TaskPool t = new TaskPool();\r\n        t.finish(true);\r\n        destroy(t);\r\n\r\n        writeln(\"Number of file descriptors: \", dirEntries(\"/proc/self/fd/\", SpanMode.breadth, false).walkLength);\r\n    }\r\n}\r\n```\r\n\r\nExample output (the numbers are always the same):\r\n```\r\n2070\r\nNumber of file descriptors: 24\r\nNumber of file descriptors: 39\r\nNumber of file descriptors: 54\r\nNumber of file descriptors: 69\r\nNumber of file descriptors: 84\r\nNumber of file descriptors: 99\r\nNumber of file descriptors: 114\r\nNumber of file descriptors: 129\r\nNumber of file descriptors: 144\r\nNumber of file descriptors: 159\r\n```"}}