-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Crashing home assistant on many added entities #809
Comments
I will try to ask original reporters for more info, not running node red myself. |
This is where debouncing is likely needed:
Ps. Not sure why this crashes HA, seems like it shouldn't do that anyway. Its probably filling the response queue with 1200 copies of the list of devices in HA. |
I can confirm that this issue is there as long as node red is running. If i stop node red, the integration can successfully ble installed. |
I also experience the same issue @AndreFjeld is describing. |
Adding a throttle to the I created a component so I could create a large number of entities or devices when it is added to HA. Testing with ranges of 1000 to 10,000 entities I couldn't get HA to crash with NR connected, this is also probably machine dependent. It did kill any websocket connection, not just NR, that was connected due to overflowing the pending message queue but HA never stop running. |
I think the supervisor in hassos will kill core if unresponsive for some given time. A watchdog. So core likely didnt crash, just not available on coms for too long. |
0.47.2 contains the throttle changes. Without NR connected to HA and only a single browser connected to UI, it is getting overloaded when 1000 entities are created in a short amount of time. The |
In this case its 1000 disabled entities. So no state_changed i think. |
Nope, looks like it still sends the event just has their state set to websocket log
[
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1301":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1301",
"supported_features":0
},
"c":"01GMSQWW20QAZMGR8T3FG2VZNZ",
"lc":1671606202.43267
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1302":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1302",
"supported_features":0
},
"c":"01GMSQWW20P23X4T6B4T9RJ34M",
"lc":1671606202.432766
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1303":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1303",
"supported_features":0
},
"c":"01GMSQWW200MCWV7Z5A2GWNH6R",
"lc":1671606202.432814
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1304":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1304",
"supported_features":0
},
"c":"01GMSQWW20N8W8X5KSYZGYQP1F",
"lc":1671606202.432856
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1305":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1305",
"supported_features":0
},
"c":"01GMSQWW20D4YCP8JPK5R8YQ5F",
"lc":1671606202.432895
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1306":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1306",
"supported_features":0
},
"c":"01GMSQWW20CKGS9MVW7XNGWMCM",
"lc":1671606202.432934
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1307":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1307",
"supported_features":0
},
"c":"01GMSQWW20CGM1HXZ89BD9BJA7",
"lc":1671606202.432973
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1308":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1308",
"supported_features":0
},
"c":"01GMSQWW21EQW43TVSBNGK6YJ4",
"lc":1671606202.433011
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1309":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1309",
"supported_features":0
},
"c":"01GMSQWW21542QQFE5JNNAJ22Q",
"lc":1671606202.433047
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1310":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1310",
"supported_features":0
},
"c":"01GMSQWW217MAKVGH1ZBCN660E",
"lc":1671606202.433145
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1311":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1311",
"supported_features":0
},
"c":"01GMSQWW21RR3EN886Q967GPXH",
"lc":1671606202.433187
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1312":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1312",
"supported_features":0
},
"c":"01GMSQWW21DBRREDSV5P0H5GGH",
"lc":1671606202.433225
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1313":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1313",
"supported_features":0
},
"c":"01GMSQWW212JD2861HFZTDM6X5",
"lc":1671606202.433262
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1314":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1314",
"supported_features":0
},
"c":"01GMSQWW21SVYFGFH0ZNV27878",
"lc":1671606202.433297
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1315":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1315",
"supported_features":0
},
"c":"01GMSQWW212FFKHM6C764MS1XN",
"lc":1671606202.433334
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1316":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1316",
"supported_features":0
},
"c":"01GMSQWW211DK1VPM8Q53Q4Z3P",
"lc":1671606202.433373
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1317":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1317",
"supported_features":0
},
"c":"01GMSQWW2150GE247095HSJSA4",
"lc":1671606202.433426
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1318":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1318",
"supported_features":0
},
"c":"01GMSQWW21QNT21GMK1MBH0XN6",
"lc":1671606202.43348
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1319":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1319",
"supported_features":0
},
"c":"01GMSQWW21PXC7284WE323V0Q7",
"lc":1671606202.433528
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1320":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1320",
"supported_features":0
},
"c":"01GMSQWW21A6S252781266R64T",
"lc":1671606202.433565
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1321":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1321",
"supported_features":0
},
"c":"01GMSQWW21HDW1VV9J8C5731A3",
"lc":1671606202.433645
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1322":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1322",
"supported_features":0
},
"c":"01GMSQWW21C2BQ9GREP4EJTECV",
"lc":1671606202.433911
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1323":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1323",
"supported_features":0
},
"c":"01GMSQWW218QK905FWFT70SFVT",
"lc":1671606202.43397
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1324":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1324",
"supported_features":0
},
"c":"01GMSQWW228NASYB9R49W1MVG6",
"lc":1671606202.434009
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1325":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1325",
"supported_features":0
},
"c":"01GMSQWW22583GS6R1K0192MTE",
"lc":1671606202.434037
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1326":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1326",
"supported_features":0
},
"c":"01GMSQWW2221SP2AF25B2EPTKH",
"lc":1671606202.434063
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1327":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1327",
"supported_features":0
},
"c":"01GMSQWW228T4Z3GB2V76RYA57",
"lc":1671606202.434108
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1328":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1328",
"supported_features":0
},
"c":"01GMSQWW228NCQHMHX6EBHDG4V",
"lc":1671606202.434213
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1329":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1329",
"supported_features":0
},
"c":"01GMSQWW221D82CD0AJB04RYJ1",
"lc":1671606202.434269
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1330":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1330",
"supported_features":0
},
"c":"01GMSQWW22X4HFRVDXT5MDS99Z",
"lc":1671606202.434311
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1331":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1331",
"supported_features":0
},
"c":"01GMSQWW22ENB9CV5B2KJE0WXY",
"lc":1671606202.434365
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1332":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1332",
"supported_features":0
},
"c":"01GMSQWW222Y0KRSGGW8FJPPVB",
"lc":1671606202.434404
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1333":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1333",
"supported_features":0
},
"c":"01GMSQWW22A8G7KM9A8931XBJC",
"lc":1671606202.434441
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1334":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1334",
"supported_features":0
},
"c":"01GMSQWW22NH6C1KAV6X69A2VN",
"lc":1671606202.43449
}
}
}
},
{
"id":2,
"type":"event",
"event":{
"a":{
"sensor.many_sensor_1335":{
"s":"unavailable",
"a":{
"restored":true,
"friendly_name":"Many sensor 1335",
"supported_features":0
},
"c":"01GMSQWW22ZYQ8M72FM5Y7D8VZ",
"lc":1671606202.434538
}
}
}
}
] |
Ok, that seem weird. They should not go into state machine. Will check on that. |
I just tested here. I don't seem to be getting these events here for disabled entities. At least not for a reload of the integration. Just to double check. Your test code did set |
Also, is the node red websocket connection making use of "permessage-deflate" websocket extension to keep the size of the websocket messages down? |
@zachowj If you enable message coalescing you'll get one or two messages instead of 1000s |
When you open the connection sending the following will tell the websocket backend to coalesce messages:
|
You'll get both types at that point: Non-coalesced
Coalesced (just wrapped in
|
Also newer versions of https://github.com/home-assistant/home-assistant-js-websocket/blob/master/lib/entities.ts |
I recall you adding that but missed the part that it needs to be activated. |
This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe the bug
When an integration is added that adds many entities. Node red seem to overload the home assistant core system and crashes home assistant.
This was noticed with an integration that adds 1200 entities from one integration setup in home-assistant/core#83759
A likely cause is no debouncing or throttling of device registry update. Standard home assistant frontend will debounce device registry updates as cen be seen here: https://github.com/home-assistant/frontend/blob/b31a9d590ef53916cc6f481efa877a57b6f756af/src/data/device_registry.ts#L103
To Reproduce
Expected behavior
Home assistant keeps running.
Screenshots
No response
Example Flow
No response
This package's version (not the Home Assistant add-on version)
Unknown
Is Node-RED running in Docker?
Yes
Node-RED version
Unknown
Node.js version
Unknown
Additional context
Upstream bug report: home-assistant/core#83759
The text was updated successfully, but these errors were encountered: