Permalink
Browse files

Issue #19296 Throw an error if the pgWorker dies.

  • Loading branch information...
1 parent b8ee425 commit 33722fab13f5fcf9e507ac485a8ebfb42b740764 @bendiy bendiy committed Apr 2, 2013
Showing with 11 additions and 0 deletions.
  1. +11 −0 node-datasource/lib/ext/datasource.js
@@ -36,6 +36,17 @@ white:true*/
callback(m.err, m.result);
});
+
+ this.worker.on('exit', function (code, signal) {
+ var pid = that.worker.pid,
+ exitCode = that.worker.exitCode,
+ signalCode = that.worker.signalCode;
+
+ X.err('pgWorker ' + pid + ' died (exitCode: ' + exitCode + ' signalCode: ' + signalCode + '). Cannot run any more queries.');
+
+ // TODO - Figure out how to restart the worker. This doesn't work.
+ //that.worker = require('child_process').fork(__dirname + '/pgworker.js');
+ });
}
// NOTE: Round robin benchmarks are slower then the above single pgworker code.

0 comments on commit 33722fa

Please sign in to comment.