-
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 always export self ECU id in available_ecu_ids #250
Conversation
sub ecu doesn't have this |
Ah, you're saying status API response, and sub ECU's statu's available_ecu_ids always empty, right? |
That is not a big problem, if sub ECU doesn't have |
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.
It is working as expected!
@@ -408,7 +444,6 @@ async def update_from_local_ecu(self, ecu_status: wrapper.StatusResponseEcuV2): | |||
"""Update ECU status storage with local ECU's status report(StatusResponseEcuV2).""" | |||
async with self._writer_lock: | |||
self.storage_last_updated_timestamp = cur_timestamp = int(time.time()) | |||
self._all_available_ecus_id.add(ecu_status.ecu_id) |
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.
👍
Commits from v3.5.1 to v3.6.0 * Bug fix 1. [Fix] boot_ctrl.cboot: post_update error handling #240 2. [Fix] otaclient_stub: fix always export self ECU id in available_ecu_ids #250 * Features 1. [Feature] extend ota-file-cache-control header #244 2. [Feature & Refinement] otaproxy: OTA file sha256 aware, support new header #245 3. [Feature & Refinement] otaproxy, otaclient: introduce external cache dev support #246 * Chore 1. doc: update document especially available_ecu_ids #248 2. [Chore] tools: add new OTA status monitor #251 3. [Chore] tools: add offline OTA image builder #252 * Deps 1. Bump grpcio from 1.40.0 to 1.53.0 in /tools/emulator #241 2. [Deps] bumps grpcio to 1.53.1 #243 3. Bump aiohttp from 3.8.1 to 3.8.5 in /otaclient #247
Description
This PR fixes unexpected behavior that
otaclient_stub.ECUStatusStorage
always add self ECU id intoavailable_ecu_ids
field when exporting. The bug is introduced whenotaclient_stub
is fully refactored in #212 .Concepts related to ECUs for loop status querying
otaclient_stub
keeps track of all reachable ECUs' status by loop polling the status API of all directly connected sub ECUs and query self ECU's internal status API. It categorizes ECUs into three groups as follow:available_ecu_ids
: a field that defined inecu_info.yaml
and merging from sub ECUs' status'savailable_ecu_ids
field, and exported in status API response. This serves information purpose only and should be passed to upper agent as it. For web.auto agent and being used to generate update request,tracked_ecus(active_ota_ecus)
: ECUs that is listed in the update request and actively doing OTA update,all_reachable_ecus
: ECUs that are reachable and status response can be seen, including all ECUs defined inecu_info.yaml
(self ECU and all directly connected sub ECUs), and all further child ECUs.Cause of the bug
Previously
otaclient_stub.ECUStatusStorage
's implementation internally mixes the concepts ofavailable_ecu_ids
,tracked_ecus(active_ota_ecus)
andall_reachable_ecus
into single attribute, effectively makingECUStatusStorage
only usesall_reachable_ecus
internally and mistakenly export this value in the status API response asavailable_ecu_ids
.Bug fix
Current behavior
available_ecu_ids
, even it is not inecu_info.yaml
.Behaivor after fix
available_ecu_ids
exported in status API response should be the same asecu_info.yaml
and merging from all sub ECUs'available_ecu_ids
,ECUStatusStorage
,available_ecu_ids
,active_ota_ecus
andall_reachable_ecus
are clearly distinguished internally:a.
available_ecu_ids
will only be updated byecu_info.yaml
and merging from sub ECUs' status report,b.
overall_ecu_status_report
is only generated againstactive_ota_ecus
(besideslost_ecus
, this property is still generated againstall_reachable_ecus
),c.
export
API will always export all status stored(status ofall_reachable_ecus
), except for ECUs that become unreachable or disconnected for a while.Related links & ticket
available_ecu_ids
.