We encountered two bugs in our own firmware that put the device into a really bad state and so I wanted to ask what the practices are to avoid this.
One bug we got stuck in a shadow update loop where we would update the AWS shadow which would trigger another shadow update message and the device would be trapped in an infinite loop and all other processes were starved.
The other bug was on the AWS side where a firmware update job kept getting requeued as soon as we finished applying the previous one. This meant the device would keep firmware updating over and over and all other processes were starved.
We fixed those bugs, however in the future I want some safeguards to prevent it in the future. Is there a way to rate limit firmware updates or otherwise prevent one rouge event from blocking everything else from running?