kengz / spacy-nlp

Expose Spacy nlp text parsing to Nodejs (and other languages) via socketIO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for SIGTERM handling not possible if spacy-nlp package is included in project

lalitgupta-blr opened this issue · comments

Background:
SIGTERM handling is required for graceful shutdown of node based micro service while running on Kubernetes. An example for SIGTERM graceful handling by node project would the following code (can be tested by sending "kill -15 pid" to the node process id).
process.on('SIGTERM', () => {
console.log('Just Received SIGTERM.');
});

Issue:
When a node project is dependant upon spacy-nlp packge then even if the above code is included in the node project, sending "kill -15 pid" to node process id results in error "INFO Exit: killed ioClient.js children" and node process exits without graceful shutdown.

After commenting the following lines, the SIGTERM is getting handled by the project file correctly.

node_modules/poly-socketio/src/start-io.js
node_modules/spacy-nlp/src/start-io.js

The reason is that these two files have SIGTERM handlers process.exit() is being called by them.

Is there is possibility of getting process.exit() called with some configuration/settings?