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

Race Condition when Auto discovering (MQTT) multiple Devices at the same time. #23542

Open
3 of 4 tasks
dtrott opened this issue Jan 2, 2025 · 0 comments
Open
3 of 4 tasks

Comments

@dtrott
Copy link

dtrott commented Jan 2, 2025

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

I have a bridge that registers (auto discovery) multiple devices via MQTT at the same time (max about 20 devices).

These are separate registrations (different topics under homeassistant/... in MQTT broker).
A small percentage (<5%) of the time one of the registration fails - doesn't appear (or disappear in the case of de-registration), on the page:

http://hostname:8123/config/devices/dashboard?historyBack=1&domain=mqtt

In practice this is a minor issue - outside of testing - the list of devices rarely changes, so an occasional browser refresh, is the total impact (refreshing the browser is sufficient to show the correct state).

I have tested with two separate machines connected to the same page (one in Firefox and one in Chrome).
When the issue occurs, it manifests identically on both browsers/machines - the both show the same missing registration.
Again refreshing the page on each laptop if sufficient to correct the information.

Describe the behavior you expected

The UI updates to show ALL newly registered or de-registered devices after a batch of MQTT auto discoveries occur.

Steps to reproduce the issue

  1. Connect to Home Assistant
  2. Browse to the MQTT Device list: http://hostname:8123/config/devices/dashboard?historyBack=1&domain=mqtt
  3. Trigger multiple devices to register (auto discovery topics) at the same time (typically all my registrations fire < 15 ms)

Note: I am using device based (not entity) auto discovery as described:

https://www.home-assistant.io/integrations/mqtt/#device-discovery-payload

What version of Home Assistant Core has the issue?

2024.12.5

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Firefox 131.0.3 (64-bit) OSX and Chrome 131.0.6778.205 (arm64)

Which operating system are you using to run this browser?

macOS (15.2) Sequioia

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

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

1 participant