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

workaround for #3382 #3427

Closed
wants to merge 1 commit into from
Closed

workaround for #3382 #3427

wants to merge 1 commit into from

Commits on Oct 5, 2023

  1. workaround for #3382

    On esp32, its possible that two threads (async_tcp, looptask) are sending out JSON via AsyncWebServer in parallel 
    - serveJson() responds to json/si, and 
    - updateInterfaces() is sending JSON state info using sendDataWs(). 
    
    This workaround uses the INTERFACE_UPDATE_COOLDOWN timer  to delay the second webSocket send command so it does not (usually) interfere with the first.
    
    It looks like the root cause that parts of AsyncWebServer are not thread-safe, and the payloads from a second ->send() call may corrupt the previous one if still being sent out.  The problem should be solved properly in AsyncWebServer, however until that happens, this workaround help to reduce the frequency of errors.
    softhack007 authored Oct 5, 2023
    Configuration menu
    Copy the full SHA
    e2886e8 View commit details
    Browse the repository at this point in the history