log child process ids in the event of an RPC timeout

pull/1/head
ansuz 3 years ago
parent 5835721322
commit ebcb6b2ab0

@ -139,6 +139,9 @@ Workers.initialize = function (Env, config, _cb) {
msg.txid = txid; msg.txid = txid;
msg.pid = PID; msg.pid = PID;
// include the relevant worker process id in messages so that it will be logged
// in the event that the message times out or fails in other ways.
msg.worker = state.pid;
// track which worker is doing which jobs // track which worker is doing which jobs
state.tasks[txid] = msg; state.tasks[txid] = msg;
@ -201,6 +204,7 @@ Workers.initialize = function (Env, config, _cb) {
const state = { const state = {
worker: worker, worker: worker,
tasks: {}, tasks: {},
pid: worker.pid, // store the child process's id in an easily accessible location
}; };
response.expect(txid, function (err) { response.expect(txid, function (err) {

Loading…
Cancel
Save