{"action":"created","issue":{"url":"https://api.github.com/repos/ring-clojure/ring/issues/205","labels_url":"https://api.github.com/repos/ring-clojure/ring/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/ring-clojure/ring/issues/205/comments","events_url":"https://api.github.com/repos/ring-clojure/ring/issues/205/events","html_url":"https://github.com/ring-clojure/ring/pull/205","id":76707748,"number":205,"title":"Prevent temp filename leak in multipart uploads","user":{"login":"fofanov","id":1063186,"avatar_url":"https://avatars.githubusercontent.com/u/1063186?v=3","gravatar_id":"","url":"https://api.github.com/users/fofanov","html_url":"https://github.com/fofanov","followers_url":"https://api.github.com/users/fofanov/followers","following_url":"https://api.github.com/users/fofanov/following{/other_user}","gists_url":"https://api.github.com/users/fofanov/gists{/gist_id}","starred_url":"https://api.github.com/users/fofanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fofanov/subscriptions","organizations_url":"https://api.github.com/users/fofanov/orgs","repos_url":"https://api.github.com/users/fofanov/repos","events_url":"https://api.github.com/users/fofanov/events{/privacy}","received_events_url":"https://api.github.com/users/fofanov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-15T12:09:04Z","updated_at":"2015-05-15T13:30:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ring-clojure/ring/pulls/205","html_url":"https://github.com/ring-clojure/ring/pull/205","diff_url":"https://github.com/ring-clojure/ring/pull/205.diff","patch_url":"https://github.com/ring-clojure/ring/pull/205.patch"},"body":"Currently the temporary file store can be used to manage multipart files, where\r\nthe deleteOnExit hook is applied to each new file. Whilst these temp files are\r\ndeleted by the temp-file-store periodically, all filenames remain in a\r\nLinkedHashSet in DeleteOnExitHook with the intention that it cleans up any\r\nremaining files on shutdown. However, for a long running service this\r\naccumulation of deleted filenames acts as a memory leak leading to heap OOM\r\nerrors. The proposed solution is to use the file-set the store is already tracking\r\nand attach our own shutdown hook that cleans up any remaining files."},"comment":{"url":"https://api.github.com/repos/ring-clojure/ring/issues/comments/102397779","html_url":"https://github.com/ring-clojure/ring/pull/205#issuecomment-102397779","issue_url":"https://api.github.com/repos/ring-clojure/ring/issues/205","id":102397779,"user":{"login":"weavejester","id":8780,"avatar_url":"https://avatars.githubusercontent.com/u/8780?v=3","gravatar_id":"","url":"https://api.github.com/users/weavejester","html_url":"https://github.com/weavejester","followers_url":"https://api.github.com/users/weavejester/followers","following_url":"https://api.github.com/users/weavejester/following{/other_user}","gists_url":"https://api.github.com/users/weavejester/gists{/gist_id}","starred_url":"https://api.github.com/users/weavejester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weavejester/subscriptions","organizations_url":"https://api.github.com/users/weavejester/orgs","repos_url":"https://api.github.com/users/weavejester/repos","events_url":"https://api.github.com/users/weavejester/events{/privacy}","received_events_url":"https://api.github.com/users/weavejester/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T13:30:08Z","updated_at":"2015-05-15T13:30:08Z","body":"Jetty 9 seems to be very slow about cleaning up its threads, leading to issues with the tests. I thought I fixed it with a 10 second timeout, but it seems even that's too short!\r\n\r\nThanks for the patch. Could you shorten the commit message a little - it doesn't need to be as long as the related PR. Something like:\r\n\r\n```\r\nPrevent temp filename leak in multipart uploads\r\n\r\nThe deleteOnExit hook adds files to a LinkedHashSet, which continues to\r\ngrow even when those files are periodically deleted. This causes a slow\r\nmemory leak, which can be solved by replacing deleteOnExit with a custom\r\nshutdown hook.\r\n```"}}