You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am doing local development, I deploy my code using balena push xxxx.local.
After each new push, the old container does not receive SIGTERM, this causes code that does GPU memory allocation to leak.
Here are some examples written in node.js .
setInterval(Function.prototype,1000);// keep app openprocess.on('SIGTERM',()=>{console.log("Received SIGTERM");// <- This is not executedprocess.exit(0);});
Here is an example that leaks using the pigpio library, it relies on SIGTERM internally to do cleanup.
setInterval(Function.prototype,1000);// keep app opentry{require('fs').unlinkSync('/var/run/pigpio.pid');console.warn('Cleaned up previous pigpio lock file, we leaked memory in a previous container :(');}catch(e){// Should to fail, lock file should not exist}const{ Gpio }=require('pigpio');newGpio(18,{mode: Gpio.OUTPUT}).digitalWrite(false);
The text was updated successfully, but these errors were encountered:
So I think the reason that this is occurring is that livepush sends a SIGKILL by default, to speed up the restart process. It sounds like we need a method of specifying whether we kill directly, or follow the standard docker process of sending SIGTERM and then killing if the container does not reply after a set amount of time.
I've created an issue on the livepush repo here to track this: balena-io-modules/livepush#49 and I'm going to close this issue, as it's not related to the supervisor.
I am doing local development, I deploy my code using
balena push xxxx.local
.After each new push, the old container does not receive SIGTERM, this causes code that does GPU memory allocation to leak.
Here are some examples written in node.js .
Here is an example that leaks using the
pigpio
library, it relies on SIGTERM internally to do cleanup.The text was updated successfully, but these errors were encountered: