{"action":"opened","issue":{"url":"https://api.github.com/repos/rapid7/leexportpy/issues/12","repository_url":"https://api.github.com/repos/rapid7/leexportpy","labels_url":"https://api.github.com/repos/rapid7/leexportpy/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/rapid7/leexportpy/issues/12/comments","events_url":"https://api.github.com/repos/rapid7/leexportpy/issues/12/events","html_url":"https://github.com/rapid7/leexportpy/issues/12","id":207079114,"number":12,"title":"Polling error","user":{"login":"steven2308","id":2533142,"avatar_url":"https://avatars.githubusercontent.com/u/2533142?v=3","gravatar_id":"","url":"https://api.github.com/users/steven2308","html_url":"https://github.com/steven2308","followers_url":"https://api.github.com/users/steven2308/followers","following_url":"https://api.github.com/users/steven2308/following{/other_user}","gists_url":"https://api.github.com/users/steven2308/gists{/gist_id}","starred_url":"https://api.github.com/users/steven2308/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steven2308/subscriptions","organizations_url":"https://api.github.com/users/steven2308/orgs","repos_url":"https://api.github.com/users/steven2308/repos","events_url":"https://api.github.com/users/steven2308/events{/privacy}","received_events_url":"https://api.github.com/users/steven2308/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-12T21:09:39Z","updated_at":"2017-02-12T21:09:39Z","closed_at":null,"body":"After running for a couple of hours in daemonized mode, we stopped receiving data. Running in debug mode we can see it continues polling again and again the same query. It's been in this cycle for more than two hours. This is part of the log:\r\n\r\n> 2017-01-30 14:17:50,108 - INFO - requests.packages.urllib3.connectionpool - MainThread - Starting new HTTPS connection (1): rest.logentries.com\r\n2017-01-30 14:17:51,000 - DEBUG - requests.packages.urllib3.connectionpool - MainThread - \"GET /query/SOME_KEY:1:SOME_OTHER_KEY?log_keys=ANOTHER_KEY&query=where(...)+calculate(percentile(95):RT) HTTP/1.1\" 200 412\r\n2017-01-30 14:17:51,018 - DEBUG - leexportpy.request_helper - MainThread - links attribute found in a subsequent continue request. Should continue polling.\r\n2017-01-30 14:17:52,020 - DEBUG - leexportpy.request_helper - MainThread - Continuing getting response...\r\n2017-01-30 14:17:52,022 - DEBUG - leexportpy.request_helper - MainThread - Making get request to the url: https://rest.logentries.com/query/SOME_KEY:1:SOME_OTHER_KEY?log_keys=ANOTHER_KEY&query=where(...)+calculate(percentile(95):RT)\r\n2017-01-30 14:17:52,025 - INFO - requests.packages.urllib3.connectionpool - MainThread - Starting new HTTPS connection (1): rest.logentries.com\r\n\r\nI checked the code and this happens because in request_helper.get_continuity_final_response() the response has the word 'links' on it, so it tries again but it does not have a limit on retrying. For some reason the LogEntries query continues to receive responses with word 'links', so it falls into an apparently infinite cycle.\r\n\r\nI added a count limit for the retries to ignore this query after some failed tries. With this improvement we now have little gaps every now and then (say 3-8 gaps every hour in total for the 18 metrics currently configured).\r\n\r\nThis has happened many times after running for some hours (it works well for a while), whether it's daemonized or not. I'm running on Ubuntu 16.10, Python 2.7.12 and leexportpy 0.1.8.\r\n\r\nThank You."}}
{"actor":{"display_login":"steven2308"}}