Closed fhunleth closed 4 months ago
I have this as draft since I've only run the unit tests. @ringlej and @abelino might be able to test it on a device that runs into the out of memory error.
See https://github.com/nerves-hub/nerves_hub_link_common/pull/35 for what was actually tested. @ringlej is using the maint_v1
branch.
There's something not quite right with this on a real device. I need to keep poking at it before we merge
The issue was something else and this seems to have the intended effect of not being noticeable on real devices :shipit:
It's possible for the firmware download to be faster than fwup can write to eMMC or MicroSD. This causes the message queue to the update manager to balloon as data starts queuing up in route to fwup. On a device without much extra memory, this can be a cause of the following error:
This commit makes the asynchronous downloader updates synchronous so fwup can push back when the writes are time consuming. The backpressure results in the TCP receive buffers filling and eventually the download slowing.