-
Notifications
You must be signed in to change notification settings - Fork 3
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_stub: fix behavior related available_ecu_ids #249
Closed
Conversation
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
Closed as new information acquired, and the fix should be re-considered and re-implemented. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR fixes unintended behavior related to the
available_ecu_ids
field in the status API response, which my ECU id will always being included in theavailable_ecu_ids
. The bug is introduced by #212 .Cause of the bug
In #212 , ECU status tracker is implemented by
_ECUTracker
, and all status are stored withinECUStatusStorage
inst. The problem is caused by_ECUTracker
by default always tracking local my ECU, no matter whether the local my ECU is listed inavailable_ecu_ids
or not. Further,ECUStatusStorage
will always include all tracked ECU intoavailable_ecu_ids
, along with merging theavailable_ecu_ids
field fromecu_info.yaml
, causing the problem.More about
available_ecu_ids
The intention for introducing
available_ecu_ids
, is to define the set of ECUs that should be engaged in OTA update events. Only ECUs listed in this field should be updated, and should be tracked by main ECU's otaclient/web.auto agent.For web.auto user, web.auto agent will use
available_ecu_ids
to generate OTA update list, only ECUs included inavailable_ecu_ids
will be included in the OTA update request.For backward compatibility, if
available_ecu_ids
is empty, include my ECU id in theavailable_ecu_ids
list. (checkecu_info.ECUInfo.get_available_ecu_ids
method).Check doc/README.md and doc/SERVICES.md for more details.
Code changes related to Bug fix
The fix is to ensure only ECUs listed in
available_ecu_ids
will be tracked byotaclient_stub
, and status being collected and reported via status API.otaclient_stub.ECUStatusStorage
: using two different attrs to store_tracking_ecus
(internal use) and_available_ecu_ids
(for used in status response), only update_available_ecu_ids
by merging sub ECU's response andecu_info.yaml
to prevent unintended changes to status response.otaclient_stub.ECUStatusStorage
: do not track and store status from child ECUs that doesn't listed in anyavailable_ecu_ids
,otaclient_stub._ECUTracker
: when launching ECU trackers for tracked ECU, check againstavailable_ecu_ids
list fromecu_info.yaml
, only tracking ECUs that listed in available_ecu_ids.Extra confirmation
ecu_info
: confirm the behavior if available_ecu_ids field is empty or not presented in ecu_info.yaml, add my ECU id into the list is implemented.Bug fix
Current behavior
available_ecu_ids
in status API response, and my ECU status also always being included in status API response, even my ECU is not listed inavailable_ecu_ids
and not expected to receive OTA update.Behaivor after fix
available_ecu_ids
and not receiving OTA update.Related links & ticket
available_ecu_ids
.