Skip to content

fix: use correct probes - #101

Merged
aaron-steinfeld merged 2 commits into
mainfrom
probing
Aug 26, 2021
Merged

aaron-steinfeld merged 2 commits into
mainfrom
probing

Conversation

@aaron-steinfeld

@aaron-steinfeld aaron-steinfeld commented Aug 25, 2021

Copy link
Copy Markdown
Contributor

Description

The main change in this PR is to replace our probing pattern. Previously (before 0.13.0) we used a static initial delay for liveness, by default 10s, upon which we began to check the tcp port for liveness. In addition, we had a readiness probe that checked the admin http server for readiness. This was close to right (the readiness probe meant the http server, not the grpc server had started - but close), but was problematic because

  • the readiness check was reflecting the admin server, rather than the actually grpc server that serves data, so the checks were not reflecting the actual health
  • the errors that were bringing down traffic to the grpc server are not recoverable - usually resource exhaustion - so even if the readiness probe was reflecting the state correctly, it would not restart the pod as we'd like. The liveness probe which would do that is just looking at a port so not particularly meaningful.
  • used a static delay, potentially leading to longer startups

In other words, the behavior we really wanted was that of the liveness probe - the problem is that if failed on startup, we'll get into a crash loop - so it needs enough of a grace period to ensure a full startup. Unfortunately, the server can take wildly different times to startup depending on instrumentation and resource allocation. So we could change the startup delay to be really large, but then we're really setting a minimum startup time, rather than maximum.

In this PR, by using a startup probe we now have the following behavior (values are configurable but defaulted):
Immediately start checking if the grpc server is healthy every 5s on startup, continuing for up to 2m. Once the server is marked live, it can begin serving traffic and we'll check the status of its grpc server every 5s to make sure it's still live. If it fails 2 consecutive checks, we'll restart the pod.

Other changes:

  • Replaced JAVA_TOOL_OPTIONS with JAVA_OPTS, better practice

Testing

I deployed this change to a local k8s cluster to verify correctness.

@codecov

codecov Bot commented Aug 25, 2021

Copy link
Copy Markdown

Codecov Report

Merging #101 (bad625d) into main (f5ee360) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #101   +/-   ##
=========================================
  Coverage     81.59%   81.59%           
  Complexity      232      232           
=========================================
  Files            28       28           
  Lines           788      788           
  Branches         57       57           
=========================================
  Hits            643      643           
  Misses           97       97           
  Partials         48       48           
Flag Coverage Δ
integration 81.59% <ø> (ø)
unit 68.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5ee360...bad625d. Read the comment docs.

@github-actions

This comment has been minimized.

Comment thread helm/values.yaml
failureThreshold: 2
startupProbe:
periodSeconds: 5
failureThreshold: 24

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh wow! is this a stop gap solution?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No - why? I gave up to 2m to attempt start up. If it's quicker than that, with this config, it will short circuit.

@aaron-steinfeld
aaron-steinfeld merged commit 494351f into main Aug 26, 2021
@aaron-steinfeld
aaron-steinfeld deleted the probing branch August 26, 2021 02:19
@github-actions

Copy link
Copy Markdown
Contributor

Unit Test Results

21 files  ±0  21 suites  ±0   12s ⏱️ ±0s
77 tests ±0  77 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 494351f. ± Comparison against base commit f5ee360.

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