daml/bazel_tools
Samir Talwar 5dd38d54e8 sandbox: PostgreSQL health checks. (#3655)
* ledger-api-test-tool: Increase the duration when watching health.

This should hopefully stop CI from flaking out.

* reference-v2/sandbox: Avoid unnecessary companion object constructors.

I like indirection… when it does something.

* ledger: Propagate empty health checks throughout the services.

* reference: Remove duplication from the ReferenceServer object.

* ledger-api-common: Actually query a "reporter" in the health service.

* ledger-api-common: Report health per-component when required.

* ledger-api-health: Use a Map to represent components for health checks.

* sandbox: Fix warnings in SqlLedgerSpec.

* ledger-api-common: Throw GrpcHealthService errors inside the Future.

* ledger: Implement health checks against the PostgreSQL connection.

Without proper testing, because I am not great at this.

* sandbox: Remove duplication and fix warnings in PostgresAround.

* sandbox: Test the SQL Ledger's health reporting on failure.

* sandbox: Don't report as unhealthy until 3 connections fail.

* ledger-api-health: Remove unused parts of the API.

Bit of premature design there.

* sandbox: Rename the "ledger" health check to "write".

* participant-state: Add the ReportsHealth trait to ReadService.

* ledger-api-common: `Future.fromTry(Try(…))` -> `Future(…)`.

* ledger-api-common: Make it clearer that StubReporter closes over health.

* ledger-api-common: Explain the HealthService watch tests with comments.

* sandbox: Clean up SqlLedger a bit.

* sandbox: Don't try and stop PostgreSQL twice in PostgresAround.

* bazel_tools: Windows rlocation lookups need to be with forward slashes.

* release: Fix case of "true".

* ledger-api-common: Make `GrpcHealthService::matchResponse` return a Try.

* ledger-api-common: Make `GrpcHealthServiceSpec` async.

* sandbox: Make a couple of DB classes final.

* sandbox: Avoid importing `X._` in PostgresAround.

* sandbox: Add clues to the SqlLedgerSpec's multiple assertions.

* sandbox: If PostgreSQL doesn't come back up, keep retrying.

* sandbox: Remove duplication in SqlLedgerSpec.

* sandbox: In SqlLedgerSpec, actually wait for the health to change.

* sandbox: In PostgresAround, make stopping PostgreSQL idempotent.

* sandbox: Simplify the SqlLedgerSpec to make it work on CI.

It's worth a shot.

* ledger-api-common: Simplify the GrpcHealthServiceSpec a little.

And add a changelog.

CHANGELOG_BEGIN

- [Ledger API Server] Add a health check endpoint conforming to the
  `GRPC Health Checking Protocol <https://github.com/grpc/grpc/blob/master/doc/health-checking.md>`_.
- [Ledger API Server] Add health checks for index database connectivity.
- [Participant State API] Add a mandatory ``currentHealth()`` method to
  ``IndexService``, ``ReadService`` and ``WriteService``.

CHANGELOG_END

* sandbox: Improve the Javadoc layout for DbDispatcher.

* sandbox: Capitalize constants in SqlExecutor.

* ledger-api-health: Convert HealthStatus to an abstract class.
2019-11-29 15:07:43 +00:00
..
client_server Remove all instances of use_default_shell_env = True (#3597) 2019-11-25 09:15:00 +00:00
dev_env_tool Windows: Take stack from dadew (#3596) 2019-11-22 17:27:42 +00:00
docs update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
java_testing update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
packaging Get grpc from nix on unix (#3632) 2019-11-26 18:47:39 +01:00
runfiles sandbox: PostgreSQL health checks. (#3655) 2019-11-29 15:07:43 +00:00
BUILD.bazel update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
docs.bzl update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
fat_cc_library.bzl update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
ghc_dwarf.bzl Add an option to build Haskell code with DWARF debug info (#2504) 2019-08-13 20:00:14 +02:00
ghci-template.sh Update rules_haskell (#3275) 2019-11-12 12:15:31 +00:00
grpc-bazel-mingw.patch Bazel 1.1 (#3249) 2019-11-11 10:06:03 +01:00
grpc-haskell-core-cpp-options.patch Replace Hazel by stack_snapshot (#2743) 2019-11-22 14:24:08 +00:00
grpc-java-plugin-visibility.patch Update to bazel-0.27 (#1957) 2019-07-05 14:04:47 +00:00
haskell_public_ghci_repl_wrapper.patch Bump rules_haskell (#2585) 2019-08-19 17:29:37 +02:00
haskell-c2hs.patch Building c2hs (#355) 2019-04-10 15:12:08 +02:00
haskell-cc-wrapper-darwin-rpath-library-dirs.patch Replace Hazel by stack_snapshot (#2743) 2019-11-22 14:24:08 +00:00
haskell-ghci-grpc.patch Replace Hazel by stack_snapshot (#2743) 2019-11-22 14:24:08 +00:00
haskell-ghcide-expose-compat.patch Replace Hazel by stack_snapshot (#2743) 2019-11-22 14:24:08 +00:00
haskell-hie-bios.patch Bump ghc-ghcide (#2936) 2019-09-18 10:29:02 +02:00
haskell-lsp-test-no-reexport.patch Upgrade ghcide and haskell-lsp (#3499) 2019-11-18 10:56:19 +00:00
haskell-no-isystem.patch Ghc lib 8.8.0.20190723 (#2279) 2019-07-25 08:59:34 +00:00
haskell-opt.patch Default to -c opt in Bazel (#2592) 2019-08-19 17:10:30 +02:00
haskell-windows-extra-libraries.patch Update rules haskell (#2509) 2019-08-13 16:46:31 +02:00
haskell-windows-remove-fake-libs.patch Replace Hazel by stack_snapshot (#2743) 2019-11-22 14:24:08 +00:00
haskell.bzl Replace Hazel by stack_snapshot (#2743) 2019-11-22 14:24:08 +00:00
hlint.bzl update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
java.bzl Upload proto and deploy jars to maven (#3507) 2019-11-18 14:40:15 +01:00
javadoc_library.bzl update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
os_info.bzl update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
pkg.bzl Remove all instances of use_default_shell_env = True (#3597) 2019-11-25 09:15:00 +00:00
pom_file.bzl Replace bazel-deps by rules_jvm_external (#3253) 2019-10-28 13:53:14 +01:00
pom_template.xml Fixes 895: Improve DA Bazel rules for building javadocs. (#896) 2019-05-14 09:40:30 +02:00
proto-zlib-url.patch Fix protobuf zlib reference (#3521) 2019-11-19 09:23:41 +00:00
proto.bzl Remove all instances of use_default_shell_env = True (#3597) 2019-11-25 09:15:00 +00:00
rules_nodejs_bash.patch open-sourcing daml 2019-04-04 09:33:38 +01:00
rules_nodejs_posix_path.patch Remove all instances of use_default_shell_env = True (#3597) 2019-11-25 09:15:00 +00:00
scala-escape-jvmflags.patch Update to bazel-0.27 (#1957) 2019-07-05 14:04:47 +00:00
scala.bzl Remove all instances of use_default_shell_env = True (#3597) 2019-11-25 09:15:00 +00:00