-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix(otaclient v3.8.x): Add timeout when downloading "metadata.jwt" and *.pem files #501
Conversation
Update source code
for more information, see https://pre-commit.ci
src/ota_metadata/legacy/parser.py
Outdated
@@ -659,7 +660,8 @@ def _process_metadata_jwt(self) -> _MetadataJWTClaimsLayout: | |||
with NamedTemporaryFile(prefix="metadata_jwt", dir=self.run_dir) as meta_f: | |||
_downloaded_meta_f = Path(meta_f.name) | |||
|
|||
while not _shutdown: | |||
_retry_counter = 0 | |||
while _retry_counter < cfg.DOWNLOAD_GROUP_INACTIVE_TIMEOUT: |
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 will be
_retry_counter * self.retry_interval < cfg.DOWNLOAD_GROUP_INACTIVE_TIMEOUT
(or_retry_counter += self.retry_interval
at line.693) - can we remove
not _shutdown
condition? I think the condition will bewhile (not _shutdown) and <<new condition>>
.
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.
What is the expected behavior when timeout is occurred? Currently, seems trying to continue metadata parsing even though the download is timeout.
for more information, see https://pre-commit.ci
|
After 5 min, I see this logMar 18 15:16:52 autoware-ecu python3[5205]: Traceback (most recent call last): This will tell FMS that the ECU is not successfully updated. |
Thank you. So |
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.
LGTM, thank you 🚀
@Zhenfeng-Sun @airkei This behavior is not intended. You simply let the ota_metadata downloading break out the downloading after 5mins, let the code continue running to verification part, and let ota_metadata validation validating nothing, finally raises an unrelated error You should let the ota_metadata downloading part raises something like |
Please refine your changes, this PR is not yet ready for merging 🙏 |
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.
Please fix the following point.
You should let the ota_metadata downloading part raises something like MetadataDownloadingFailed exception, and let the ota_client.py handles this MetadataDownloadingFailed, and logging the situation.
Related JIRA: RT4-15059
About the fix
At the beginning of OTA process, we will download "medata.jwt" file and then "certificate" pem file.
There are cases that these files can not be downloaded correctly.
For example:
1, ECU network config is not correct.
2, The certificate file is not correct
etc...
When it happens, current behavior is that "otaclient" keep retry endlessly.
For the end user, he will not be aware of the error and will likely keep waiting for a long time.
This fix will timeout the retrying process after 5 mins.
End user will be informed OTA is not successful after that.