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

Cleanup healthcheck code after V2 removal #13655

Merged
merged 9 commits into from
May 6, 2022
Merged

Conversation

serathius
Copy link
Member

@serathius serathius marked this pull request as draft January 28, 2022 10:05
@serathius serathius force-pushed the health branch 3 times, most recently from 893813b to 81847a5 Compare February 2, 2022 12:53
@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2022

Codecov Report

Merging #13655 (e19cf7a) into main (9aaa6d8) will decrease coverage by 0.15%.
The diff coverage is 76.92%.

❗ Current head e19cf7a differs from pull request most recent head 233ca3c. Consider uploading reports for the commit 233ca3c to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13655      +/-   ##
==========================================
- Coverage   72.73%   72.58%   -0.16%     
==========================================
  Files         467      469       +2     
  Lines       38287    38262      -25     
==========================================
- Hits        27847    27771      -76     
- Misses       8642     8675      +33     
- Partials     1798     1816      +18     
Flag Coverage Δ
all 72.58% <76.92%> (-0.16%) ⬇️

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

Impacted Files Coverage Δ
server/etcdserver/api/etcdhttp/types/errors.go 73.33% <ø> (ø)
server/proxy/httpproxy/reverse.go 63.02% <ø> (ø)
server/etcdserver/api/etcdhttp/debug.go 14.28% <14.28%> (ø)
server/embed/etcd.go 74.80% <66.66%> (-0.05%) ⬇️
server/etcdserver/api/etcdhttp/health.go 83.13% <83.13%> (ø)
server/etcdserver/api/etcdhttp/version.go 90.00% <90.00%> (ø)
server/config/config.go 79.76% <100.00%> (ø)
server/etcdmain/etcd.go 45.48% <100.00%> (ø)
server/etcdserver/api/etcdhttp/metrics.go 100.00% <100.00%> (+24.24%) ⬆️
server/etcdserver/api/etcdhttp/peer.go 88.00% <100.00%> (ø)
... and 25 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 9aaa6d8...233ca3c. Read the comment docs.

@serathius serathius marked this pull request as ready for review February 2, 2022 15:39
@serathius
Copy link
Member Author

cc @ptabor @ahrtr @spzala

server/config/config.go Outdated Show resolved Hide resolved
if !first {
fmt.Fprintf(w, ",\n")
}
first = false
Copy link
Member

Choose a reason for hiding this comment

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

Can you move the first = false into the if branch?

Copy link
Member Author

Choose a reason for hiding this comment

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

This file is extracted from server/etcdserver/api/etcdhttp/base.go just to keep one file per endpoint. Would prefer not to mix file structure refactors with logic ones. There is no unit tests for this code, so I try to avoid logical changes.

@@ -414,7 +414,7 @@ func startProxy(cfg *config) error {
go func() {
lg.Info("v2 proxy started listening on client requests", zap.String("host", host))
mux := http.NewServeMux()
etcdhttp.HandlePrometheus(mux) // v2 proxy just uses the same port
etcdhttp.HandleMetrics(mux) // v2 proxy just uses the same port
Copy link
Member

Choose a reason for hiding this comment

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

Is the comment "v2 proxy just uses the same port" still valid?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes? there is no semantic change in this rename.

server/etcdserver/api/etcdhttp/health_test.go Show resolved Hide resolved
server/etcdserver/api/etcdhttp/health_test.go Show resolved Hide resolved
server/etcdserver/api/etcdhttp/health_test.go Show resolved Hide resolved
server/etcdserver/api/etcdhttp/health_test.go Outdated Show resolved Hide resolved
@ahrtr
Copy link
Member

ahrtr commented Mar 10, 2022

You need to format the source code using gofmt, and there are a couple of failures as well. Usually if there is only one failure, it may be caused by flaky test. But if there are more then 2, then we could be caused by code change in the PR.

@ahrtr
Copy link
Member

ahrtr commented Apr 19, 2022

@serathius can you rebase this PR?

I think we need to get this one merged firstly, so that I can rework my PR 13772 on top of this one.

@serathius
Copy link
Member Author

Done.

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

cc @ptabor @spzala

@ahrtr
Copy link
Member

ahrtr commented May 5, 2022

Although there may be still some refactors to be done, this PR should be good to go, because it's at least an improvement on current implementation. This PR may have some impact on other PRs, can we get this one merged? @ptabor @spzala

@serathius Could you rebase this PR, so as to make sure it doesn't break any pipelines? Previously we had an experience which was breaking the pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants