Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does a redeploy "cleanup" previous deploys? #20

Open
nkolban opened this issue Aug 16, 2016 · 3 comments
Open

Does a redeploy "cleanup" previous deploys? #20

nkolban opened this issue Aug 16, 2016 · 3 comments

Comments

@nkolban
Copy link

nkolban commented Aug 16, 2016

I am using Node-RED 0.14.6 with Node.js 4.4.7. When I deploy a flow that contains a "Johnny5" node, all works well. If I change my logic and re-deploy, it is as though the previous deployment is still active concurrently with the new deployment. Does a redeployment cause the "cleanup" of previous deployments? When I stop Node-RED and restart it, all works again as desired until the next redeploy.

@monteslu
Copy link
Owner

So, there's quite a bit of hackery in this...

For pagenodes I can run johnny-five in a webworker and just dump the webworker on redeploy: https://github.com/monteslu/pagenodes/blob/master/src/red/nodes/nodeDefs/io/lib/nodebotNode.js#L168 Works like a champ.

For node-red i have to try and clean up after myself since the same javascript VM persists. What this means is that I try clearing intervals and disconnecting things: https://github.com/monteslu/node-red-contrib-gpio/blob/master/lib/nodebotNode.js#L43-L99

The problem with my node-red method of cleaning up is I might be leaving stuff out there that my own testing hasn't noticed.

I cant try and reproduce your specific error if you want to share some code from the johnny5 node you're deploying.

A better long term solution might be to use node's clustering mechanism to spawn a thread for each connected nodebot. I need to investing this some more.

@nkolban
Copy link
Author

nkolban commented Aug 16, 2016

Here is an attachment including my exported flow:
flow.txt

I also produced a video on using the "Johnny5" node:

https://www.youtube.com/watch?v=zy-uMLru7fQ

This doesn't illustrate the problem, but does show the example flow. If I change the flow and redeploy, pressing the button shows the debug happening as many times as I have redeployed.

@Ib2cool
Copy link

Ib2cool commented Feb 16, 2019

This is still an issue: "button shows the debug happening as many times as I have redeployed"
This is reproduce-able with "gpio in" wired to debug node and with "Johnny5" node wired to debug node
Any fix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants