When using socket CAN node red event loop is blocking

flows (60).json (104.4 KB)

Im sending 12 broadcast requests from socket can for every 250ms, parallely 6 devices will repond with 36 responses

Please provide more detail

For 1: Adding your flows is of little use to people who dont have your devices or dont use the CAN nodes. But at a guess, try slowing them down or staggering the requests to run in sequence instead of parallel.

Can you identify the CAN node full package in the flows library?

How do you know it is "blocking"?

Yes it is there in flows library,

whenever I function node at socket can rx node, its event loop is blocking.
Im using blockify js module to detect event loop pauses

I just want to know one thing the function node receiving bulk data from socket can rx node, whether it will block the event loop or run the function node asynchrnously ?

Which one!

Show us how.

If it is running a hard loop inside the blockly generated code, then YES, looping is (probably) synchronous and WILL block. However, it would have to be rather large to be noticeable.


As with your other thread, there simply isnt enough information to give to definitive answers or solutions.

In order to check whether your function node is causing the block then, as suggested in your other thread, remove all wires from the can nodes' outputs and just connect to debug nodes. Then see if it still blocks.

flows (53).json (91.9 KB)
Import this flow and check

Ignore previous flow whichever i have given

No thank you. I dont use Blockly or CAN nodes & I am not installing them on my Node-RED.

If you want further help, please answer the questions.

I removed all wires from function node coming out from the socket can output node, and added debug node then the event loop is not blocking

So it is not the CAN node causing the problem, it is something downstream from there.