Processing of Node-Red during deploy

If there is currently a flow processed while "deploying" a flow, from my understanding the current flow is aborted (wherever it is) and everything that is currently in the queue is forgotten until a new trigger starts a flow.
Is this correct?
Is there any way to apply new deployed flow(s) only for new incoming data?
Is there a planned feature to change this behaviour in the future?

You are correct - for a full deploy, all nodes are stopped without regard for any messages that may still be flowing.

You can use the modified-flows/nodes type of deploy so any unchanged nodes are left running. But anything that has changes to apply will get stopped and restarted.

The messaging api changes we introduced in Node-RED 1.0 was the first step in doing something about this. Once the runtime is able to track the completion of messages as they pass through the flow, it will be able to do a more graceful shutdown and allow existing work to complete.

However, it isn't that straightforward. Node-RED doesn't know what nodes in a flow are generating new work, versus continuing to handle work already in the system.

There is a draft pull-request that adds the ability for the user to identify which nodes in a flow should be stopped first, in order to halt new work arriving, and then allowing the rest of the flow a grace period before it gets stopped. But there's still a lot of work to do to make sure that model works. It hasn't had much attention, but is something we need to come back to at some point.

Thank you @knolleary :slight_smile:

Just a thought, once the 'only new' content deploy feature is present, will it become the default deploy mode? That would make sense no?

You set the deploy mode for your instance of the editor - so it's your default.

@Nodi.Rubrum the ability to only deploy changed nodes is already there - you pick the deploy type via the drop-down menu on the Deploy button:

Right, I was just wondering, or suggesting the idea that when this 'smarter' deployment feature is real, available, maybe it should be the default deploy mode, across the board, unless operator changes it of course.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.