MCPcopy Index your code
hub / github.com/PrairieLearn/PrairieLearn / _handleChildExit

Method _handleChildExit

lib/code-caller.js:301–321  ·  view source on GitHub ↗
(code, signal)

Source from the content-addressed store, hash-verified

299 }
300
301 _handleChildExit(code, signal) {
302 debug(`enter _handleChildExit(), state: ${String(this.state)}, uuid: ${this.uuid}`);
303 this._checkState([WAITING, IN_CALL, EXITING]);
304 load.endJob('python', this.uuid);
305 delete activeCallers[this.uuid];
306 if (this.state == WAITING) {
307 this._logError('PythonCaller child process exited while in state = WAITING, code = ' + String(code) + ', signal = ' + String(signal));
308 this.child = null;
309 this.state = EXITED;
310 } else if (this.state == IN_CALL) {
311 this._clearTimeout();
312 this.child = null;
313 this.state = EXITED;
314 this._callCallback(new Error('PythonCaller child process exited unexpectedly, code = ' + String(code) + ', signal = ' + String(signal)));
315 } else if (this.state == EXITING) {
316 // no error, this is the good case
317 this.child = null;
318 this.state = EXITED;
319 }
320 debug(`exit _handleChildExit(), state: ${String(this.state)}, uuid: ${this.uuid}`);
321 }
322
323 _handleChildError(error) {
324 debug(`enter _handleChildError(), state: ${String(this.state)}, uuid: ${this.uuid}`);

Callers

nothing calls this directly

Calls 6

_checkStateMethod · 0.95
_logErrorMethod · 0.95
_clearTimeoutMethod · 0.95
_callCallbackMethod · 0.95
debugFunction · 0.85
endJobMethod · 0.80

Tested by

no test coverage detected