{"action":"closed","issue":{"url":"https://api.github.com/repos/snowplow/snowplow-python-tracker/issues/142","labels_url":"https://api.github.com/repos/snowplow/snowplow-python-tracker/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/snowplow/snowplow-python-tracker/issues/142/comments","events_url":"https://api.github.com/repos/snowplow/snowplow-python-tracker/issues/142/events","html_url":"https://github.com/snowplow/snowplow-python-tracker/issues/142","id":100093630,"number":142,"title":"Synchronous flush should wait for the task queue to empty even if the buffer is empty when it is called","user":{"login":"fblundun","id":5892914,"avatar_url":"https://avatars.githubusercontent.com/u/5892914?v=3","gravatar_id":"","url":"https://api.github.com/users/fblundun","html_url":"https://github.com/fblundun","followers_url":"https://api.github.com/users/fblundun/followers","following_url":"https://api.github.com/users/fblundun/following{/other_user}","gists_url":"https://api.github.com/users/fblundun/gists{/gist_id}","starred_url":"https://api.github.com/users/fblundun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fblundun/subscriptions","organizations_url":"https://api.github.com/users/fblundun/orgs","repos_url":"https://api.github.com/users/fblundun/repos","events_url":"https://api.github.com/users/fblundun/events{/privacy}","received_events_url":"https://api.github.com/users/fblundun/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/snowplow/snowplow-python-tracker/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"fblundun","id":5892914,"avatar_url":"https://avatars.githubusercontent.com/u/5892914?v=3","gravatar_id":"","url":"https://api.github.com/users/fblundun","html_url":"https://github.com/fblundun","followers_url":"https://api.github.com/users/fblundun/followers","following_url":"https://api.github.com/users/fblundun/following{/other_user}","gists_url":"https://api.github.com/users/fblundun/gists{/gist_id}","starred_url":"https://api.github.com/users/fblundun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fblundun/subscriptions","organizations_url":"https://api.github.com/users/fblundun/orgs","repos_url":"https://api.github.com/users/fblundun/repos","events_url":"https://api.github.com/users/fblundun/events{/privacy}","received_events_url":"https://api.github.com/users/fblundun/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/snowplow/snowplow-python-tracker/milestones/11","html_url":"https://github.com/snowplow/snowplow-python-tracker/milestones/Version%200.7.1","labels_url":"https://api.github.com/repos/snowplow/snowplow-python-tracker/milestones/11/labels","id":1248374,"number":11,"title":"Version 0.7.1","description":"","creator":{"login":"fblundun","id":5892914,"avatar_url":"https://avatars.githubusercontent.com/u/5892914?v=3","gravatar_id":"","url":"https://api.github.com/users/fblundun","html_url":"https://github.com/fblundun","followers_url":"https://api.github.com/users/fblundun/followers","following_url":"https://api.github.com/users/fblundun/following{/other_user}","gists_url":"https://api.github.com/users/fblundun/gists{/gist_id}","starred_url":"https://api.github.com/users/fblundun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fblundun/subscriptions","organizations_url":"https://api.github.com/users/fblundun/orgs","repos_url":"https://api.github.com/users/fblundun/repos","events_url":"https://api.github.com/users/fblundun/events{/privacy}","received_events_url":"https://api.github.com/users/fblundun/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2015-08-10T15:19:10Z","updated_at":"2015-08-11T10:51:36Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-08-10T15:24:37Z","updated_at":"2015-08-11T10:51:36Z","closed_at":"2015-08-11T10:51:36Z","body":"[The relevant code](https://github.com/snowplow/snowplow-python-tracker/blob/792bec6852a056674a25f411b74bdafcb0b83246/snowplow_tracker/emitters.py#L295-L297)\r\n\r\nSuppose I call sync_flush before my application exits to block until all buffered and queued events have been sent. If the buffer happens to be empty at the time of the call, the body of the while loop will never execute. This means that my application can exit before all events stored in the task queue get a chance to be sent."}}