-
Notifications
You must be signed in to change notification settings - Fork 205
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
Ledger API: Add healthcheck endpoints. #3573
Conversation
We can use the version in io.grpc:grpc-services instead.
CHANGELOG_BEGIN - [Ledger API] Add healthcheck endpoints, conforming to the `GRPC Health Checking Protocol <https://github.com/grpc/grpc/blob/master/doc/health-checking.md>`_. It is always ``SERVING`` for now. - [DAML Ledger Integration Kit] Add conformance test coverage for the ``grpc.health.v1.Health`` service. CHANGELOG_END
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.
Mostly LGTM, can you have a close look at the comments in TimeBoundObserver
before merging?
ledger/sandbox/src/main/scala/com/digitalasset/ledger/server/apiserver/ApiServices.scala
Show resolved
Hide resolved
ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/health/DropRepeated.scala
Outdated
Show resolved
Hide resolved
ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/health/DropRepeated.scala
Outdated
Show resolved
Hide resolved
ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/health/package.scala
Outdated
Show resolved
Hide resolved
...sandbox/src/test/suite/scala/com/digitalasset/platform/sandbox/health/DropRepeatedSpec.scala
Outdated
Show resolved
Hide resolved
...andbox/src/test/suite/scala/com/digitalasset/platform/sandbox/health/HealthServiceSpec.scala
Outdated
Show resolved
Hide resolved
ledger/test-common/src/main/scala/com.digitalasset.platform.testing/TimeBoundObserver.scala
Outdated
Show resolved
Hide resolved
Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
In an attempt to get it working on CI.
Keep it in one file.
At some point it was being used twice.
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.
Thanks. One comment we should talk about is Protobuf-Java vs. ScalaPB service implementation.
class HealthService(watchThrottleFrequency: FiniteDuration = 1.second)( | ||
implicit materializer: Materializer, | ||
executionContext: ExecutionContext | ||
) extends HealthGrpc.HealthImplBase { |
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.
I'd prefer if we could stick with the scalapb rpc implementation for services, otherwise we start having a mix of how services are implemented.
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.
On it.
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.
Done.
ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/health/HealthService.scala
Outdated
Show resolved
Hide resolved
And refactor a lot of test code to make it easy to test.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
"src/main/scala/**/*.scala", | ||
]), | ||
tags = [ | ||
"maven_coordinates=com.digitalasset.ledger-api:rs-grpc-testing-utils:__VERSION__", |
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.
Yay, the release check actually worked 🎉
Step 1 of implementing #2733.
Compliant with the GRPC Health Checking Protocol.
These are always
SERVING
for now.I'd like to make the Sandbox report
NOT_SERVING
when, for example, the PostgreSQL connection is lost, but this will require a bunch of testing and a lot more code, so I'd like to stage the work.Also forthcoming: documentation on how to use this endpoint (spoiler:
grpc-health-probe
), and how to make your own ledger report its health accurately.Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tags, if appropriateNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.