Skip to content

fix(ecu_status): add LocalECUStatusNotReady exception and handle in gRPC service#930

Open
airkei wants to merge 1 commit intomainfrom
fix/await-for-self-status
Open

fix(ecu_status): add LocalECUStatusNotReady exception and handle in gRPC service#930
airkei wants to merge 1 commit intomainfrom
fix/await-for-self-status

Conversation

@airkei
Copy link
Copy Markdown
Collaborator

@airkei airkei commented Apr 28, 2026

Description

This PR fix the existing issues that FMS Console outputs the following errors when OTA is triggered.

Update request to OTA client failed.
autoware are listed as available_ecu_ids, but autoware: not responding

This happens when autoware is listed in available_ecu_ids but Status response(ecu_v2 field) doesn't include autoware.

Check list

  • test files that cover the bug case(s) are implemented.
  • local tests are passing.
  • created a test image and tested on FMS Dev environment

Bug fix

Current behavior

The gRPC API server starts and begins answering Status RPCs before the OTA core finishes its bootstrap and writes its first OTAClientStatus into shared memory. Meanwhile available_ecu_ids is already populated synchronously from ecu_info.yaml at storage construction.

The result is a StatusResponse where:

  • available_ecu_ids contains the local ECU (e.g. autoware)
  • ecu_v2 does not contain an entry for the local ECU

Downstream agents can misread this as "the ECU is alive but reporting no status," which is semantically ambiguous and not a transient signal the caller knows to retry on. The polling task itself never crashes, so the symptom is silent.

Behavior after fix

Make the Status RPC return UNAVAILABLE instead of an asymmetric StatusResponse (where the local ECU appears in available_ecu_ids but is missing from ecu_v2) during the startup window before the OTA core has written its first status into shared memory.

Behavior matrix:

Local ECU configuration Local status in storage export() result
OTA-managed (in available_ecu_ids) absent raises LocalECUStatusNotReadyUNAVAILABLE
OTA-managed (in available_ecu_ids) present normal StatusResponse
Proxy/aggregator (not in available_ecu_ids) absent normal StatusResponse (steady state, not a startup race)
Proxy/aggregator (not in available_ecu_ids) present normal StatusResponse

Related links & ticket

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

📊 OTA Update Performance Comparison Report

Generated: 2026-04-28T04:47:58.497419

⏱️ Execution Time

Phase Legacy (s) V1 (s)
Total Duration 27.8 27.4
Metadata Processing 2.0 2.0
Delta Calculation 11.0 9.0
Download 2.0 3.0
Apply Update 6.0 7.0
Post Update 0.0 0.0
Finalization 0.0 0.0

@airkei airkei force-pushed the fix/await-for-self-status branch from bfe3729 to 6389fd3 Compare April 28, 2026 04:46
@airkei airkei marked this pull request as ready for review April 28, 2026 04:52
@airkei airkei requested a review from a team as a code owner April 28, 2026 04:52
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant