{"action":"closed","issue":{"url":"https://api.github.com/repos/skwuent/skwutil/issues/1","labels_url":"https://api.github.com/repos/skwuent/skwutil/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/skwuent/skwutil/issues/1/comments","events_url":"https://api.github.com/repos/skwuent/skwutil/issues/1/events","html_url":"https://github.com/skwuent/skwutil/issues/1","id":117715401,"number":1,"title":"dropticker unable to run for 48 hours without crashing","user":{"login":"btrask","id":301663,"avatar_url":"https://avatars.githubusercontent.com/u/301663?v=3","gravatar_id":"","url":"https://api.github.com/users/btrask","html_url":"https://github.com/btrask","followers_url":"https://api.github.com/users/btrask/followers","following_url":"https://api.github.com/users/btrask/following{/other_user}","gists_url":"https://api.github.com/users/btrask/gists{/gist_id}","starred_url":"https://api.github.com/users/btrask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btrask/subscriptions","organizations_url":"https://api.github.com/users/btrask/orgs","repos_url":"https://api.github.com/users/btrask/repos","events_url":"https://api.github.com/users/btrask/events{/privacy}","received_events_url":"https://api.github.com/users/btrask/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-19T00:45:48Z","updated_at":"2015-12-01T00:41:32Z","closed_at":"2015-12-01T00:41:32Z","body":"Hi,\r\n\r\nI've been an avid user of dropticker for a couple years now. Recently as my business has scaled I've noticed that it is unable to handle the increased load. This holds for both the Python and Ruby versions.\r\n\r\nPython - crashes after around 8 minutes\r\nRuby - crashes after around 1 hour\r\n\r\nAfter examining the code, I discovered that these otherwise excellent programs both have the same minor flaw: relying on function recursion for their main loop. Each iteration, the language runtime (Python and Ruby respectively) will allocate a new stack frame. After the stack space is exhausted, the program will crash.\r\n\r\nIn Python, the default recursion limit is 1000, and the program sleeps half a second per iteration, meaning it will stop after about 8 minutes. Ruby uses the C stack without an explicit limit, meaning it lasts a little bit longer, but not much.\r\n\r\nThe most straightforward solution is to convert these programs to use loops instead of recursion.\r\n\r\nFor now I have worked around these problems by using `sys.setrecursionlimit` in Python and raising the ulimit in Ruby. But this solution is little more than a stopgap. Please fix this problem before my ability to provide for my family is thrown into jeopardy!\r\n\r\nThank you once again for this fantastic software.\r\n\r\nMore information:\r\n- https://stackoverflow.com/questions/13591970/does-python-optimize-tail-recursion\r\n- https://stackoverflow.com/questions/824562/does-ruby-perform-tail-call-optimization\r\n- https://stackoverflow.com/questions/3323001/maximum-recursion-depth\r\n- https://stackoverflow.com/questions/242617/how-to-increase-stack-size-for-a-ruby-app-recursive-app-getting-stack-level-to"}}