Skip to content

aa: improve code quality by propagating gRPC server errors - #1799

Open
1hcoj wants to merge 1 commit into
confidential-containers:mainfrom
1hcoj:fix/aa-grpc-server-errors
Open

1hcoj wants to merge 1 commit into
confidential-containers:mainfrom
1hcoj:fix/aa-grpc-server-errors

Conversation

@1hcoj

@1hcoj 1hcoj commented Oct 11, 2026

Copy link
Copy Markdown

When the configured gRPC port is already in use, start_grpc_service() returns an error, but main discards it in tokio::select!. As a result, grpc-aa logs AA exits. and exits with status 0 despite failing to start the server.

This small code quality improvement propagates the server error with the socket address as context, so startup failures report their cause and return a nonzero exit status. It also changes the pre-bind log from listening to Starting to avoid claiming readiness before binding.

Adds a server unit test for an occupied port and executable integration tests for an occupied port and an invalid socket address. The tests require no TEE hardware or KBS service.

Validation:

cargo test --locked -p attestation-agent --no-default-features \
  --features bin,grpc --bin grpc-aa --test grpc_startup -- --nocapture
cargo clippy --locked -p attestation-agent --no-default-features \
  --features bin,grpc --bin grpc-aa --test grpc_startup -- -D warnings
cargo fmt --all -- --check

Signed-off-by: chihyeon cho <sagokgo16@gmail.com>
@1hcoj
1hcoj requested a review from a team as a code owner October 11, 2026 05:55

This branch has not been deployed

No deployments
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