{"action":"closed","issue":{"url":"https://api.github.com/repos/mozilla-services/autopush/issues/378","repository_url":"https://api.github.com/repos/mozilla-services/autopush","labels_url":"https://api.github.com/repos/mozilla-services/autopush/issues/378/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-services/autopush/issues/378/comments","events_url":"https://api.github.com/repos/mozilla-services/autopush/issues/378/events","html_url":"https://github.com/mozilla-services/autopush/issues/378","id":136549056,"number":378,"title":"Reduce 503 occasions","user":{"login":"bbangert","id":100193,"avatar_url":"https://avatars.githubusercontent.com/u/100193?v=3","gravatar_id":"","url":"https://api.github.com/users/bbangert","html_url":"https://github.com/bbangert","followers_url":"https://api.github.com/users/bbangert/followers","following_url":"https://api.github.com/users/bbangert/following{/other_user}","gists_url":"https://api.github.com/users/bbangert/gists{/gist_id}","starred_url":"https://api.github.com/users/bbangert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbangert/subscriptions","organizations_url":"https://api.github.com/users/bbangert/orgs","repos_url":"https://api.github.com/users/bbangert/repos","events_url":"https://api.github.com/users/bbangert/events{/privacy}","received_events_url":"https://api.github.com/users/bbangert/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mozilla-services/autopush/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"jrconlin","id":35755,"avatar_url":"https://avatars.githubusercontent.com/u/35755?v=3","gravatar_id":"","url":"https://api.github.com/users/jrconlin","html_url":"https://github.com/jrconlin","followers_url":"https://api.github.com/users/jrconlin/followers","following_url":"https://api.github.com/users/jrconlin/following{/other_user}","gists_url":"https://api.github.com/users/jrconlin/gists{/gist_id}","starred_url":"https://api.github.com/users/jrconlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrconlin/subscriptions","organizations_url":"https://api.github.com/users/jrconlin/orgs","repos_url":"https://api.github.com/users/jrconlin/repos","events_url":"https://api.github.com/users/jrconlin/events{/privacy}","received_events_url":"https://api.github.com/users/jrconlin/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mozilla-services/autopush/milestones/7","html_url":"https://github.com/mozilla-services/autopush/milestones/PUSHSVC-0:%20quality","labels_url":"https://api.github.com/repos/mozilla-services/autopush/milestones/7/labels","id":1369355,"number":7,"title":"PUSHSVC-0: quality","description":"An ongoing milestone into which we can schedule maintenance tasks, tech-debt paydown, and other code-quality-related issues.","creator":{"login":"bbangert","id":100193,"avatar_url":"https://avatars.githubusercontent.com/u/100193?v=3","gravatar_id":"","url":"https://api.github.com/users/bbangert","html_url":"https://github.com/bbangert","followers_url":"https://api.github.com/users/bbangert/followers","following_url":"https://api.github.com/users/bbangert/following{/other_user}","gists_url":"https://api.github.com/users/bbangert/gists{/gist_id}","starred_url":"https://api.github.com/users/bbangert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbangert/subscriptions","organizations_url":"https://api.github.com/users/bbangert/orgs","repos_url":"https://api.github.com/users/bbangert/repos","events_url":"https://api.github.com/users/bbangert/events{/privacy}","received_events_url":"https://api.github.com/users/bbangert/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":39,"state":"open","created_at":"2015-10-21T22:36:45Z","updated_at":"2016-03-04T20:04:57Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-02-25T23:50:44Z","updated_at":"2016-03-04T20:04:57Z","closed_at":"2016-03-04T20:04:57Z","body":"When a user leaves, and a new notification comes in, we clear the node and return a 503 to try again. That can push a decent amount of work onto the app-server, it would likely be better to actually continue the logic in endpoint, such that:\r\n\r\n- clear the node entry\r\n- save the notification\r\n- new node lookup\r\n- tell node to fetch messages if there\r\n\r\nSo essentially all we'd do is remove the raise exception, and let the message be saved immediately. That would reduce this 503 path, without much of a db hit change since most of the time the user has left and we are going to be storing the message for awhile."}}