{"action":"created","issue":{"url":"https://api.github.com/repos/jarohen/nomad/issues/31","repository_url":"https://api.github.com/repos/jarohen/nomad","labels_url":"https://api.github.com/repos/jarohen/nomad/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/jarohen/nomad/issues/31/comments","events_url":"https://api.github.com/repos/jarohen/nomad/issues/31/events","html_url":"https://github.com/jarohen/nomad/issues/31","id":195245309,"number":31,"title":"\"hostname\" program is called every time the config is read","user":{"login":"raskig","id":3204818,"avatar_url":"https://avatars.githubusercontent.com/u/3204818?v=3","gravatar_id":"","url":"https://api.github.com/users/raskig","html_url":"https://github.com/raskig","followers_url":"https://api.github.com/users/raskig/followers","following_url":"https://api.github.com/users/raskig/following{/other_user}","gists_url":"https://api.github.com/users/raskig/gists{/gist_id}","starred_url":"https://api.github.com/users/raskig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raskig/subscriptions","organizations_url":"https://api.github.com/users/raskig/orgs","repos_url":"https://api.github.com/users/raskig/repos","events_url":"https://api.github.com/users/raskig/events{/privacy}","received_events_url":"https://api.github.com/users/raskig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-13T12:52:28Z","updated_at":"2016-12-13T18:05:57Z","closed_at":null,"body":"We are using Nomad for retrieving config every time an endpoint is called of a web service. As we see from the logs, every time the config is read the \"hostname\" in shell is also called. This results in the following error after a while:\r\n\"java.io.IOException: Cannot run program \"hostname\": error=24, Too many open files\"\r\nPlease confirm that this is a valid bug.\r\nThanks,\r\nGabor\r\n"},"comment":{"url":"https://api.github.com/repos/jarohen/nomad/issues/comments/266814544","html_url":"https://github.com/jarohen/nomad/issues/31#issuecomment-266814544","issue_url":"https://api.github.com/repos/jarohen/nomad/issues/31","id":266814544,"user":{"login":"raskig","id":3204818,"avatar_url":"https://avatars.githubusercontent.com/u/3204818?v=3","gravatar_id":"","url":"https://api.github.com/users/raskig","html_url":"https://github.com/raskig","followers_url":"https://api.github.com/users/raskig/followers","following_url":"https://api.github.com/users/raskig/following{/other_user}","gists_url":"https://api.github.com/users/raskig/gists{/gist_id}","starred_url":"https://api.github.com/users/raskig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raskig/subscriptions","organizations_url":"https://api.github.com/users/raskig/orgs","repos_url":"https://api.github.com/users/raskig/repos","events_url":"https://api.github.com/users/raskig/events{/privacy}","received_events_url":"https://api.github.com/users/raskig/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T18:05:57Z","updated_at":"2016-12-13T18:05:57Z","body":"Hi @jarohen,\r\nI think it is enough if it calls the \"hostname\" every time. My understanding is that the operation system will run out of file descriptors after a while when the load is high..\r\n\r\nThis is the exception we face after a while:\r\n```\r\n@40000000584fb9a93503e44c java.io.IOException: Cannot run program \"hostname\": error=24, Too many open files\r\n@40000000584fb9a93503f7d4 \tat java.lang.ProcessBuilder.start(ProcessBuilder.java:1047) ~[na:1.7.0_111]\r\n@40000000584fb9a93503f7d4 \tat java.lang.Runtime.exec(Runtime.java:617) ~[na:1.7.0_111]\r\n@40000000584fb9a93503fbbc \tat clojure.java.shell$sh.doInvoke(shell.clj:116) ~[cljrc-web-120-standalone.jar:na]\r\n@40000000584fb9a93503fbbc \tat clojure.lang.RestFn.invoke(RestFn.java:408) ~[cljrc-web-120-standalone.jar:na]\r\n    @40000000584fb9a93504038c \tat nomad$get_hostname.invoke(nomad.clj:43) ~[cljrc-web-  120-standalone.jar:na]\r\n    @40000000584fb9a93504038c \tat nomad$update_config.invoke(nomad.clj:168) ~[cljrc-web-120-standalone.jar:na]\r\n@40000000584fb9a93504038c \tat nomad$read_config.doInvoke(nomad.clj:181) ~[cljrc-web-120-standalone.jar:na]\r\n```\r\nI was able to reproduce the problem by using a load test. By applying a quick fix (wrapping the (config) call in a (memoize config) ) it fixes the problem, but of course we loose the ability to change the config on the fly.\r\n\r\nHope this all makes sense.\r\n"}}
{"actor":{"display_login":"raskig"}}