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

Fix race condition in web_server scheduler on ESP32 #3951

Merged
merged 2 commits into from
Dec 22, 2022

Conversation

tomaszduda23
Copy link
Contributor

@tomaszduda23 tomaszduda23 commented Oct 26, 2022

What does this implement/fix?

Race condition in scheduler

Web component schedule things from async_tcp thread which leads to race condition.
It puts things to queue and schedule them from main thread.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes
esphome/issues#2916
esphome/issues#2632
#3943
#3917
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • ESP32-S2

Example entry for config.yaml:

# Example config.yaml

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@ssieb
Copy link
Member

ssieb commented Oct 27, 2022

Is this an issue specific to ESP32 and not applicable to ESP8266?

@tomaszduda23
Copy link
Contributor Author

Is this an issue specific to ESP32 and not applicable to ESP8266?

ESP8266 uses different library ottowinter/ESPAsyncTCP-esphome. I took quick look and cannot see any task there. @OttoWinter are you able to confirm that? I have no ESP8266 to test.

@tomaszduda23
Copy link
Contributor Author

esphome/issues#3780

@jesserockz jesserockz changed the title fix race condition in scheduler Fix race condition in web_server scheduler on ESP32 Dec 22, 2022
@jesserockz jesserockz merged commit 50e8e92 into esphome:dev Dec 22, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2022
bdraco added a commit to bdraco/esphome that referenced this pull request Jan 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants