-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup flow of error handling and retries for OTA updates (#17072)
* - Added CHIP_ERROR_MAX_RETRY_EXCEEDED. Changed UpdateNotFound() to return CHIP_ERROR value. - Reversed order of state change call and action calls. * - Remove un-used GenericOTARequestorDriver::HandleError() * - Added GenericOTARequestorDriver::ScheduleRetry() * - Move DefaultOTARequestorDriver::ScheduleRetry() from public to protected API - Re-instate DefaultOTARequestorDriver::HandleError() to handle re-tries on errors. * scripts/helpers/restyle-diff.sh * - Changed mServer NULL ptr check to VerifyOrDie() check - If UpdateFailureState::kQuerying error is CHIP_ERROR_BUFFER_TOO_SMALL, set to idle. Else retry. * - Remove un-used mUpdateNotFoundReason and mRetryDelaySec from DefaultOTARequestorDriver * - In DefaultOTARequestorDriver::SendQueryImage(), change state to currentUpdateState * - Renamed ScheduleRetry to ScheduleQueryRetry() - Updated CHIPError.cpp for CHIP_ERROR_MAX_RETRY_EXCEEDED - In DefaultOTARequestorDriver::ScheduleQueryRetry(), moved VerifyOrDie NULL check on mRequestor into the block in which it is used. - Added function header comment for ScheduleQueryRetry() * - In DefaultOTARequestor::OnQueryImageResponse(), moved definition of status into OTAQueryStatus::kBusy and OTAQueryStatus::kNotAvailable blocks. - Removed un-used UpdateFailureState::kAwaitingNextAction enum - In DefaultOTARequestor::OnQueryImageResponse(), for case OTAQueryStatus::kNotAvailable, transition to idle regardless of return value of UpdateNotFound() so that we can perform the next Query * - Added CHIP_ERROR_MAX_RETRY_EXCEEDED to TestCHIPErrorStr.cpp - Removed UpdateFailureState::kIdle case from DefaultOTARequestorDriver::HandleError() - Removed ‘Ignore error and transition to Idle’ comments from DefaultOTARequestorDriver::HandleError() - In DefaultOTARequestorDriver::ScheduleQueryRetry(), moved definition of providerLocation into the block where it’s used * - In ExtendedOTARequestorDriver::UpdateAvailable(), added HandleError() call back. - In enum class UpdateFailureState, removed kIdle - In DefaultOTARequestorDriver::ScheduleQueryRetry(), removed status and willTryAnotherQuery variables. * - In DefaultOTARequestorDriver::UpdateNotFound()< reduced code by calling ScheduleQueryRetry() * - Added CHIP_ERROR_PROVIDER_LIST_EXHAUSTED error case to be used in DefaultOTARequestorDriver::ScheduleQueryRetry() * - Remove DefaultOTARequestorDriver::HandleError() * Remove un-used UpdateFailureState enum class * In DefaultOTARequestorDriver::ScheduleQueryRetry(), add status variable to store return status and return at the end of the function to resolve CI compilation error: ../src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp:449:9: error: do not use 'else' after 'return' [readability-else-after-return,-warnings-as-errors] * In DefaultOTARequestorDriver::ScheduleQueryRetry(), add CHIP_NO_ERROR check before scheduling retry to prevent scheduling retry when provider list has been exhasuted or when max retries has been exhausted. * Update function comments for RecordErrorUpdateState()
- Loading branch information
1 parent
483c282
commit 293c89a
Showing
9 changed files
with
144 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.