-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Update AsyncWebServer and enable response queue #4516
Conversation
Includes update to use matching newer AsyncTCP on ESP32
Enable the new concurrent request and queue size limit features of AsyncWebServer. This should improve the handling of burst traffic or many clients, and significantly reduce the likelihood of OOM crashes due to HTTP requests.
This can be helpful for debugging web handler related issues.
Use the web server's queuing mechanism to call us back later.
No locking contention, but a much larger target
platformio.ini
Outdated
@@ -259,7 +259,7 @@ large_partitions = tools/WLED_ESP32_8MB.csv | |||
extreme_partitions = tools/WLED_ESP32_16MB_9MB_FS.csv | |||
lib_deps = | |||
https://github.com/lorol/LITTLEFS.git | |||
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 | |||
willmmiles/AsyncTCP @ 1.3.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor style thing - can you please define this in a common section then reference rather than repeated definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that comment wasn't clear enough. I didn't mean a mass restructure of all common aspects of the envs, just you lib definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I don't understand, then. This particular lib_dep, and the associated build_flag (-D CONFIG_ASYNC_TCP_USE_WDT=0
) are examples of flags common to all ESP32 platforms; however the current platformio.ini treats each hardware platform as independent. It doesn't make sense to me to make a new common section for some arbitrary subset of the "all ESP32" options, but leave others behind?
- It would be wrong to put this specification in the "[common]" section as this library is platform specific
- It would be wrong to put this in the "[esp32]" section, as that section is a machine specification for the single group of no-suffix chips (ie. it is like "[esp32s2]"); evidenced by the platform specification in that section that applies only to those specific chips, and other contents in the
build_flags
- It would be wrong to create an "[esp32_common]" section for just this one library and its build_flags, and ignore the other common build flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Let's hang fire on and cleanup refactoring for now, leaving your repeated definition and then have a dedicated PR to do the cleanup of the envs, rather than mixing the desired style with this PR while leaving existing issues unresolved or blurring the scope of this PR, which then causes other issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this instance it's ok to just do a reset and force push to remove the final commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also going to be merged soon https://github.com/Aircoookie/WLED/pull/3835/files#diff-4446afd728a4f34cbcddc306a9cb6be845d1a61c216076a295683bcc9c106724
Good news, let's get this into main and get others using it too. We can then decide if we backport to 0.15.x if it's bringing stability improvements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only refactor the lib dep
094ed7c
to
2181618
Compare
Update to the current versions of AsyncWebServer and AsyncTCP, and enable the new AsyncWebServer response queuing feature. This allows for deferring responses when the JSON buffer is locked, or if the system is low on memory. It also adds an "emergency" 503 response if the system does not have enough memory to serve a request. The updated AsyncTCP includes a redesign of the event queue which attempts to ensure that connections won't be leaked if the system runs out of memory.
I've been testing this for about a year now. I think it's as ready as it's going to get.
Replaces #4119