Skip to content

Fix potential MQTT discovery race condition#17208

Merged
balloob merged 3 commits intohome-assistant:devfrom
OttoWinter:fix-mqtt-discovery-race-condition
Oct 8, 2018
Merged

Fix potential MQTT discovery race condition#17208
balloob merged 3 commits intohome-assistant:devfrom
OttoWinter:fix-mqtt-discovery-race-condition

Conversation

@OttoWinter
Copy link
Copy Markdown
Member

Description:

Fixes #17004 (review) by introducing a global lock on all discovery config entry loading.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@OttoWinter OttoWinter requested a review from a team as a code owner October 7, 2018 09:30
@ghost ghost assigned OttoWinter Oct 7, 2018
@ghost ghost added the in progress label Oct 7, 2018
}

ALREADY_DISCOVERED = 'mqtt_discovered_components'
CONFIG_ENTRY_LOCK = 'mqtt_config_entry_lock'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you prefix this with DATA_ so it's more clear what it's used for.

@balloob balloob added this to the 0.80 milestone Oct 8, 2018
@ghost ghost assigned balloob Oct 8, 2018
@balloob balloob merged commit 3f498bd into home-assistant:dev Oct 8, 2018
@ghost ghost removed the in progress label Oct 8, 2018
@OttoWinter OttoWinter deleted the fix-mqtt-discovery-race-condition branch October 8, 2018 11:45
balloob pushed a commit that referenced this pull request Oct 8, 2018
* Fix potential MQTT discovery race condition

* Rename data key
@balloob balloob mentioned this pull request Oct 12, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants