RFC: Web Workflow reliability and performance improvements #7836
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What started as an investigation of un-explained 403 errors from what I think
is a questionable CORS implementation along with interface hangs and connection
timeouts, I would like to propose the attached changes to the web_workflow
service. [Note: The CORS implementation is another topic not covered here.]
Observed problems (ESP32 platforms):
run and attempt to post background task requests.
is still in use by select polling thread.
These changes address, in no particular order:
There may be other issues here and I am hoping for some more eyes/testing on these proposed
changes. I have been running these changes for over 2-weeks on an UMFeatherS2 now with
no loss of service. The device sleeps for 20min, then wakes and takes a number of
sensor readings and posts them to a MQTT server and adafruit.io and goes back to sleep.
The device also polls the MQTT server for notice to not sleep in order to allow connection
via Web Workflow for maintenance.
After stabilizing the ESP32 environment, I have testing these changes on the RPi
implementation. The Web Workflow processing model works fine now with both the ESP32
and RPi given the significant differences in socket handling (polling vs. callbacks).
No further work was required to the RPi socket layer as was necessary with the ESP32
sockets/lwip layer. In fact, the ESP32 implementation seems to be a lot more responsive
and on-par with the RPi now.