codex-blackboard
codex-blackboard copied to clipboard
Better handle transient Google Drive errors
The Google Drive API occasionally (but rarely) throws a transient exception:
I20140119-00:40:55.490(-5)? Exception while invoking method 'newPuzzle' [object Object]
I20140119-00:40:55.491(-5)? at Object.Future.wait (/home/codex/.meteor/tools/7cf8f178ae/lib/node_modules/fibers/future.js:326:15)
I20140119-00:40:55.491(-5)? at Object.exec (packages/meteor/helpers.js:111)
I20140119-00:40:55.491(-5)? at Object.createPuzzle (server/drive.coffee:110:4)
I20140119-00:40:55.492(-5)? at Object.createPuzzle (server/drive.coffee:40:4)
I20140119-00:40:55.492(-5)? at newDriveFolder (lib/model.coffee:393:10)
I20140119-00:40:55.492(-5)? at Meteor.methods.newPuzzle (lib/model.coffee:554:6)
I20140119-00:40:55.492(-5)? at maybeAuditArgumentChecks (packages/livedata/livedata_server.js:1349)
I20140119-00:40:55.492(-5)? at packages/livedata/livedata_server.js:569
I20140119-00:40:55.493(-5)? at _.extend.withValue (packages/meteor/dynamics_nodejs.js:35)
I20140119-00:40:55.493(-5)? at packages/livedata/livedata_server.js:568
This would result in a given puzzle object not being created all by Meteor. (Did the transaction roll back when we got an exception? Or did db sync get interrupted?)
In any case, we should catch and handle this case, probably by retrying the google drive api invocation, since I've written that to be idempotent.
Is it possible this was a quota error and my change to retry with backoff fixed it? It's hard to tell because you were printing the prototype of the exception instead of the exception itself.