Potential problems when stopping a meteor without blame

Just hitting the Meteor, which by many accounts seems like a great project. One potential problem (which may not be the case) seems to be a meteor stop or other programmatic way to gracefully close a meteorite. Please let me know if I am wrong about this!

Are there potential problems with maintaining the integrity of the database (for example) if we interrupt the process using CTRL-C or close it using Activity Monitor? And is it possible to take measures to reduce or eliminate such problems?

Caution I understand that the questions above are somewhat vague, and I understand that this is usually considered harmful to Stack, but I hope they still answer.

Thanks,

+4
source share
2 answers

It seems like a cleanup happens before the process completes ( https://github.com/meteor/meteor/blob/master/tools/cleanup.js ).

The first SIGINT signal sent, which is a polite way to ask the process to shut down (and give it time to complete the last thread)

With database integrity, the mongod process also tries to clean itself before it shuts down, and it has a recovery mechanism (from the log files) for quick recovery on restart if it is forced to shut down.

If I say that in the middle of a longer stream, I’m not sure whether he is allowed to finish or to kill him immediately. But the meteor is trying to give him the opportunity to first get a graceful ending, and then transfer it to SIGHUP , and then a SIGTERM (which is still a graceful completion signal). Under no circumstances is meteor shower or the sending of SIGKILL or SIGSTOP.

Thus, meteorite applications should be safe from the completion of Ctrl + C. With the completion of the monitor, it depends on what type of signal is sent (i.e. Force to exit or just exit)

+1
source

So, to add to this limitation, if your mongodb is controlled externally, that is, on the server of the production server, the meteorite does not stop it, as mongo-runner.js notes:

 // Since it is externally managed, asking it to actually stop would be // impolite, so our stoppable handle is a noop if (process.env.MONGO_URL) { launch_callback(); return handle; } 
0
source

Source: https://habr.com/ru/post/1480006/


All Articles