sasjs / server

Build Apps on Base SAS
https://server.sasjs.io
MIT License
20 stars 3 forks source link

nodejs server kills itself #320

Open argenx-pmason opened 1 year ago

argenx-pmason commented 1 year ago

When using the extension I find that every so often, usually if I havent run something for a while, the server has stopped running and I have to restart it. There doesnt seem to be any reason. No message or warning. Please fix.

allanbowe commented 1 year ago

Hi Phil - are you able to attempt persistence using the pm2 npm tool?

https://github.com/sasjs/server#persisting-the-session

There is nothing in the server itself that forces a stoppage, rather it is a system issue. Hence the need for a 'wrapper' facility to keep the session alive.

argenx-pmason commented 1 year ago

Thanks - I will try that.

jbodart-argenx commented 1 year ago

For me, using pm2 on windows solved the problem of the server being stopped and not restarted. Now it restarts automatically, so there is always a server ready to process my programs.

However pm2 does not prevent the server stopping while waiting for a long running program to complete. In such a case the submitted program seems to terminate prematurely, and the log file retrieved only contains:

read ECONNRESET