<div dir="ltr"><div class="gmail_extra">Chatted a bit with José Valim about this.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I had read the APIs related to process shutdown, but I had not seen the big picture. A conventionally written OTP application has a way to boot, but had not grasped that it has also a way to shutdown and you program to play well wit it. Aha!</div><div class="gmail_extra"><br></div><div class="gmail_extra">So the auto-answer to my question (please don't hesitate to correct me or add anything) is that every service needs to take a conscious decision about this. Logic, timeouts, and so on. In some cases exiting is going to be inmediate. A periodical task may wait for completion if exiting happens in the middle of it, but schedule no more runs (off the top of my head). In the case of a somewhat long-running process like file uploading, guess a normal strategy would be similar: to allow their exit handlers to wait for the upload to complete and program this logic. Their supervisor would set appropriate generous timeouts or infinity accordingly. In such a system it is a consequence of this that you should expect shutdown to take whatever those processes need.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Beautifull!</div><div class="gmail_extra"><br></div></div>