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

Refactor healthcheck signalling between server and service #5308

Merged

Conversation

WillSewell
Copy link
Contributor

Which problem is this PR solving?

Resolves #5307

Description of the changes

  • Simplifies the signalling of healthcheck status from the "servers" to the "service": instead of using 2 channels to feed healthcheck status back to the Service.HealthCheck, we just give the server components direct access to the Healthcheck which they can update directly.
  • This is possible because the Healthcheck package is threadsafe (uses atomic.Value for state).
  • This pattern is consistent with how the service's Healtcheck is passed directly to cmd/collector/app package.

How was this change tested?

  • make lint test

Checklist

Simplifies the signalling of healthcheck status from the "servers"
to the "service": instead of using 2 channels to feed healthcheck
status back to the Service.HealthCheck, we just give the server
components direct access to the Healthcheck which they can update
directly. This is possible because the Healthcheck package is
threadsafe (uses `atomic.Value` for state).

This pattern is consisten with how the service's Healtcheck is
passed directly to cmd/collector/app package.

closes jaegertracing#5307

Signed-off-by: Will Sewell <willsewell@monzo.com>
@@ -48,23 +48,23 @@ import (
// Server runs HTTP, Mux and a grpc server
type Server struct {
logger *zap.Logger
healthCheck *healthcheck.HealthCheck
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I felt like this was nicer ordering because this felt related to the logger to me since they both come from the service and are both related to "reporting status".

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 95.06%. Comparing base (0be0cb9) to head (0c5307e).

Files Patch % Lines
...md/jaeger/internal/extension/jaegerquery/server.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5308      +/-   ##
==========================================
- Coverage   95.09%   95.06%   -0.04%     
==========================================
  Files         340      340              
  Lines       16626    16612      -14     
==========================================
- Hits        15811    15792      -19     
- Misses        628      631       +3     
- Partials      187      189       +2     
Flag Coverage Δ
badger 13.26% <ø> (ø)
cassandra-3.x 26.44% <ø> (ø)
cassandra-4.x 26.44% <ø> (ø)
elasticsearch-5.x 21.68% <ø> (ø)
elasticsearch-6.x 21.70% <ø> (+0.01%) ⬆️
elasticsearch-7.x 21.77% <ø> (ø)
elasticsearch-8.x 21.87% <ø> (ø)
grpc 11.00% <0.00%> (+0.03%) ⬆️
kafka 14.73% <ø> (ø)
opensearch-1.x 21.78% <ø> (+0.01%) ⬆️
opensearch-2.x 21.78% <ø> (ø)
unittests 92.24% <95.45%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro yurishkuro enabled auto-merge (squash) March 28, 2024 20:39
@yurishkuro yurishkuro merged commit 7c9dce4 into jaegertracing:main Mar 28, 2024
37 of 38 checks passed
@WillSewell WillSewell deleted the refactor-healthcheck-channels branch March 28, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor]: Remove the use of channels to signal healthcheck status
2 participants