Closed othiym23 closed 9 years ago
It looks like it's getting an uncaught exception during shutdown
If the following function fails due to something coming from Mongo, it's not clear to me where the callback with the error information will be handled, but it appears to be propagated out of ldatastore.js
function getMongo(owner, type, callback) {
var m = colls[owner][type];
if(!m) {
try {
mongo[owner].addCollection(owner, type);
} catch (E) {
return callback(E, []);
}
m = colls[owner][type];
}
return m;
}
https://github.com/LockerProject/Locker/pull/876 should make it easier to debug uncaught exceptions during shutdown
That is definitely a bug - that function should just throw the error as it is sync and the async functions above it should try catch.
Beyond that, looks like a bug in ldatastore or lsyncmanager. Something is passing an Object instead of a function as the callback to removeCurrent
in ldatastore.
I'm going to fig the first bug, put in some debug code and let it run.
As best I can tell, when building the async queue in either the deleteData
or addData
functions of ldatastore, something goes wrong and results in a callback being set for an individual queue task that isn't actually a function so when async tries to call apply
it can't. I wrapped the queue's process function to print a debug statement if it catches an error. The debug statement will look like this:
ERROR: caught error while processing q on task <task with bad callback>
It won't bring the whole ship down now, but we should take the try catch out once we understand and fix this.
Closing as abandoned.
Saw the following error in a locker, restored it from last good backup, waited an hour or so, and got the exact same error on the exact same event: