{"action":"created","issue":{"url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever/issues/12","repository_url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever","labels_url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever/issues/12/comments","events_url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever/issues/12/events","html_url":"https://github.com/NYPL-discovery/sierra-retriever/issues/12","id":223181235,"number":12,"title":"Should Promises.all reject everything when just one fails?","user":{"login":"jobinthomasnypl","id":10273671,"avatar_url":"https://avatars2.githubusercontent.com/u/10273671?v=4","gravatar_id":"","url":"https://api.github.com/users/jobinthomasnypl","html_url":"https://github.com/jobinthomasnypl","followers_url":"https://api.github.com/users/jobinthomasnypl/followers","following_url":"https://api.github.com/users/jobinthomasnypl/following{/other_user}","gists_url":"https://api.github.com/users/jobinthomasnypl/gists{/gist_id}","starred_url":"https://api.github.com/users/jobinthomasnypl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jobinthomasnypl/subscriptions","organizations_url":"https://api.github.com/users/jobinthomasnypl/orgs","repos_url":"https://api.github.com/users/jobinthomasnypl/repos","events_url":"https://api.github.com/users/jobinthomasnypl/events{/privacy}","received_events_url":"https://api.github.com/users/jobinthomasnypl/received_events","type":"User","site_admin":false},"labels":[{"id":602402975,"url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever/labels/pipeline_prodready","name":"pipeline_prodready","color":"1d76db","default":false}],"state":"closed","locked":false,"assignee":{"login":"jobinthomasnypl","id":10273671,"avatar_url":"https://avatars2.githubusercontent.com/u/10273671?v=4","gravatar_id":"","url":"https://api.github.com/users/jobinthomasnypl","html_url":"https://github.com/jobinthomasnypl","followers_url":"https://api.github.com/users/jobinthomasnypl/followers","following_url":"https://api.github.com/users/jobinthomasnypl/following{/other_user}","gists_url":"https://api.github.com/users/jobinthomasnypl/gists{/gist_id}","starred_url":"https://api.github.com/users/jobinthomasnypl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jobinthomasnypl/subscriptions","organizations_url":"https://api.github.com/users/jobinthomasnypl/orgs","repos_url":"https://api.github.com/users/jobinthomasnypl/repos","events_url":"https://api.github.com/users/jobinthomasnypl/events{/privacy}","received_events_url":"https://api.github.com/users/jobinthomasnypl/received_events","type":"User","site_admin":false},"assignees":[{"login":"jobinthomasnypl","id":10273671,"avatar_url":"https://avatars2.githubusercontent.com/u/10273671?v=4","gravatar_id":"","url":"https://api.github.com/users/jobinthomasnypl","html_url":"https://github.com/jobinthomasnypl","followers_url":"https://api.github.com/users/jobinthomasnypl/followers","following_url":"https://api.github.com/users/jobinthomasnypl/following{/other_user}","gists_url":"https://api.github.com/users/jobinthomasnypl/gists{/gist_id}","starred_url":"https://api.github.com/users/jobinthomasnypl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jobinthomasnypl/subscriptions","organizations_url":"https://api.github.com/users/jobinthomasnypl/orgs","repos_url":"https://api.github.com/users/jobinthomasnypl/repos","events_url":"https://api.github.com/users/jobinthomasnypl/events{/privacy}","received_events_url":"https://api.github.com/users/jobinthomasnypl/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever/milestones/8","html_url":"https://github.com/NYPL-discovery/sierra-retriever/milestone/8","labels_url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever/milestones/8/labels","id":2527267,"number":8,"title":"Sprint 18","description":"","creator":{"login":"jobinthomasnypl","id":10273671,"avatar_url":"https://avatars2.githubusercontent.com/u/10273671?v=4","gravatar_id":"","url":"https://api.github.com/users/jobinthomasnypl","html_url":"https://github.com/jobinthomasnypl","followers_url":"https://api.github.com/users/jobinthomasnypl/followers","following_url":"https://api.github.com/users/jobinthomasnypl/following{/other_user}","gists_url":"https://api.github.com/users/jobinthomasnypl/gists{/gist_id}","starred_url":"https://api.github.com/users/jobinthomasnypl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jobinthomasnypl/subscriptions","organizations_url":"https://api.github.com/users/jobinthomasnypl/orgs","repos_url":"https://api.github.com/users/jobinthomasnypl/repos","events_url":"https://api.github.com/users/jobinthomasnypl/events{/privacy}","received_events_url":"https://api.github.com/users/jobinthomasnypl/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":6,"state":"open","created_at":"2017-05-17T16:10:30Z","updated_at":"2017-08-18T17:25:56Z","due_on":"2017-05-30T07:00:00Z","closed_at":null},"comments":0,"created_at":"2017-04-20T19:57:14Z","updated_at":"2017-08-18T17:25:56Z","closed_at":"2017-08-18T17:25:56Z","body":"When the service reads a bunch of records from kinesis, we use Promises.all to get schema and query sierra api. Right now, when one fails, we don't reject the entire Promise.all response, but just log the error and move on, so that the successful ones are not retried. Not sure if this is the right approach or not. "},"comment":{"url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever/issues/comments/323412934","html_url":"https://github.com/NYPL-discovery/sierra-retriever/issues/12#issuecomment-323412934","issue_url":"https://api.github.com/repos/NYPL-discovery/sierra-retriever/issues/12","id":323412934,"user":{"login":"jobinthomasnypl","id":10273671,"avatar_url":"https://avatars2.githubusercontent.com/u/10273671?v=4","gravatar_id":"","url":"https://api.github.com/users/jobinthomasnypl","html_url":"https://github.com/jobinthomasnypl","followers_url":"https://api.github.com/users/jobinthomasnypl/followers","following_url":"https://api.github.com/users/jobinthomasnypl/following{/other_user}","gists_url":"https://api.github.com/users/jobinthomasnypl/gists{/gist_id}","starred_url":"https://api.github.com/users/jobinthomasnypl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jobinthomasnypl/subscriptions","organizations_url":"https://api.github.com/users/jobinthomasnypl/orgs","repos_url":"https://api.github.com/users/jobinthomasnypl/repos","events_url":"https://api.github.com/users/jobinthomasnypl/events{/privacy}","received_events_url":"https://api.github.com/users/jobinthomasnypl/received_events","type":"User","site_admin":false},"created_at":"2017-08-18T17:25:56Z","updated_at":"2017-08-18T17:25:56Z","body":"Looking at the code again,\r\n\r\n```\r\n.then((schemas) => {\r\n      return getDetailedResource(records, schemas)\r\n    })\r\n    .then((results) => {\r\n      var resultsForStream = []\r\n      results.forEach((entry) => {\r\n        if (entry.error) {\r\n          callback(entry.error, `Failed to get marc in json for ${entry.record}`)\r\n        } else if (entry.record.id) {\r\n          resultsForStream.push(entry.record)\r\n        }\r\n      })\r\n```\r\nEven if getDetailedResource doesn't reject the promise on an error, the promise chain checks if the object returned has an error and if so, then call the callback function of the lambda with the error to execute the whole batch again."}}
{"actor":{"display_login":"jobinthomasnypl"}}