Skip to content
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

Add gRPC health check #3888

Merged
merged 1 commit into from
May 3, 2023
Merged

Add gRPC health check #3888

merged 1 commit into from
May 3, 2023

Conversation

aoudiamoncef
Copy link
Contributor

@aoudiamoncef aoudiamoncef commented May 2, 2023

  • document all added functions
  • try in sandbox /simulation/labnet
  • unit tests on the added/changed features
    • make tests compile
    • make tests pass
  • add logs allowing easy debugging in case the changes caused problems
  • if the API has changed, update the API specification

🤖 Generated by Copilot at cbdc4c4

Summary

🩺🛠️📄

This pull request adds a gRPC health service to the MassaService and allows users to enable or disable it via the config file. It also fixes a bug in the ScExecutionEventContext message definition in the massa-proto crate.

We are the Massa, we serve the gRPC
We check our health with enable_health
We fix our bugs and we load our config
We rock the network with MassaService

Walkthrough

  • Add a new field enable_health to the GrpcConfig struct and the GrpcSettings struct to allow users to configure the gRPC health service via the config file (link, link)
  • Pass the enable_health value from the config file to the gRPC server initialization in the main function (link)
  • Create and add an optional HealthService to the gRPC server based on the enable_health flag in the start function of massa-grpc/src/server.rs (link, link, link)
  • Define and spawn a task to periodically update the health status of the MassaService using a HealthReporter and a stub function massa_service_status in massa-grpc/src/server.rs (link, link)
  • Fix a bug in the tag numbers of the ScExecutionEventContext message definition in massa-proto/src/massa.api.v1.rs (link)

@aoudiamoncef aoudiamoncef requested a review from modship May 2, 2023 10:38
@aoudiamoncef aoudiamoncef marked this pull request as ready for review May 2, 2023 12:05
@aoudiamoncef aoudiamoncef requested a review from AurelienFT May 3, 2023 11:04
@aoudiamoncef aoudiamoncef force-pushed the feature/health-check branch from cbdc4c4 to 7b34781 Compare May 3, 2023 11:40
@aoudiamoncef aoudiamoncef force-pushed the feature/health-check branch from 7b34781 to 4d21452 Compare May 3, 2023 16:21
Copy link
Contributor

@AurelienFT AurelienFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok to merge this for 22

@aoudiamoncef aoudiamoncef merged commit deb5818 into testnet_22 May 3, 2023
@aoudiamoncef aoudiamoncef deleted the feature/health-check branch May 3, 2023 17:47
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.

2 participants