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

Add TO Go cdns/health and cdns/{name}/health #2305

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

rob05c
Copy link
Member

@rob05c rob05c commented May 19, 2018

Rewrites /cdns/health and /cdns/{{name}}/health to Go. Closes #3778 and closes #3779 .

@asfgit
Copy link
Contributor

asfgit commented May 19, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR/1623/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented May 20, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR/1624/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented May 22, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR/1646/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Jun 5, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR/1761/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Jun 23, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/1896/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Jun 23, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/1897/
Test PASSed.

@rob05c rob05c force-pushed the to-go-cdnhealth branch 2 times, most recently from 8b9adb6 to 7ec9108 Compare June 23, 2018 18:50
@asfgit
Copy link
Contributor

asfgit commented Jun 23, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/1900/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Jun 25, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/1907/
Test PASSed.

@@ -53,6 +53,8 @@ type DeliveryServiceName string
// CacheType is the type (or tier) of a CDN cache.
type CacheType string

const MonitorTypeName = "RASCAL"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we think this should be a config? I have seen several times now where the type "RASCAL" was hard-coded and we had to change our TM type. IMO you should be able to make the type whatever you want and it should work.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it should definitely be a config, once we've moved everything to Go. But right now, it's still hard-coded all over Perl.

I don't think we should make a config yet, which would make people think they could change it, when it'd still break to be anything but "RASCAL".

But definitely +100 when it's all Go, and we can set one variable. I've wanted to change our db "RASCAL" type to something like "monitor" for ages.

@dneuman64
Copy link
Contributor

I would expect a heathtest.go to be a part of this PR is there a reason it is not included?

@rob05c
Copy link
Member Author

rob05c commented Jun 26, 2018

Not sure what you mean. What would be in healthtest.go?

@asfgit
Copy link
Contributor

asfgit commented Jul 5, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/1998/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Jul 9, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2039/
Test PASSed.

@asfgit
Copy link
Contributor

asfgit commented Jul 19, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2114/
Test FAILed.

@mitchell852 mitchell852 added this to the Go Rewrite milestone Sep 13, 2019
@mitchell852 mitchell852 added tech debt rework due to choosing easy/limited solution and removed new feature A new feature, capability or behavior labels Sep 13, 2019
@mitchell852 mitchell852 self-assigned this Sep 13, 2019
@asf-ci
Copy link
Contributor

asf-ci commented Sep 16, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/4256/
Test PASSed.

Copy link
Contributor

@mhoppa mhoppa left a comment

Choose a reason for hiding this comment

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

One minor comment - also should we be adding tests?

return monitors, nil
}

func GetCRStates(monitorFQDN string, client *http.Client) (tc.CRStates, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

@rob05c rob05c Sep 16, 2019

Choose a reason for hiding this comment

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

Yes, they were copy-pasted, because the PRs were open at the same time, with the intention of combining them after one was merged to master. Good catch. I'll do that now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Also with GetCRConfig.

@rob05c
Copy link
Member Author

rob05c commented Sep 16, 2019

also should we be adding tests?

This endpoint calls out to Traffic Monitor. The "API Test" framework doesn't currently support Monitors. It's also not really possible to unit test; we could mock everything, but it wouldn't be testing much of anything at that point (which is why we've been doing "API Tests" for TO).

We should definitely test this (and other Monitor endpoints) when the API Tests support it. But it'll be a nontrivial amount of work to add that support.

I just made #3924 - we had one for Riak, but not Monitors.

mitchell852
mitchell852 previously approved these changes Sep 18, 2019
@mitchell852
Copy link
Member

mitchell852 commented Sep 18, 2019

@rob05c and @mhoppa - i believe this PR is going to have the same problem that was addressed in #3927 , right?

@mhoppa
Copy link
Contributor

mhoppa commented Sep 19, 2019

Yes it will have the same problem

@mitchell852 mitchell852 dismissed their stale review September 25, 2019 20:36

there is a bug

Copy link
Member

@mitchell852 mitchell852 left a comment

Choose a reason for hiding this comment

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

@rob05c - i think this PR needs the changes that were made in #3927

@rob05c
Copy link
Member Author

rob05c commented Sep 27, 2019

I'd like to look into #3927 first. Not sure when I'll have time.

It shouldn't be necessary, HTTP/2 is backwards-compatible by design. If a client tries to use H2, and a server doesn't support it, it automatically falls back to H1. If it doesn't, the Server is violating HTTP/1.1. So, it shouldn't ever be necessary to forcibly disable it. I'd like to at least understand why it's necessary.

@asf-ci
Copy link
Contributor

asf-ci commented Dec 11, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/4908/

@rob05c
Copy link
Member Author

rob05c commented Dec 11, 2019

Ok, I investigated, determined Go 1.13 http.Transport fundamentally doesn't support H2 Proxies. I added the code from #3927 and a comment to that effect. See golang/go#26479 "We only support http1 proxies currently."

Rebased; manually tested again, still works as expected, still matches Perl.

@asf-ci
Copy link
Contributor

asf-ci commented Dec 11, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/4910/

@asf-ci
Copy link
Contributor

asf-ci commented Dec 11, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/4913/

Copy link
Contributor

@mhoppa mhoppa left a comment

Choose a reason for hiding this comment

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

code looks good and tests locally good

Copy link
Member

@mitchell852 mitchell852 left a comment

Choose a reason for hiding this comment

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

appears to work as the Perl did.

@mitchell852 mitchell852 merged commit 0b02a3c into apache:master Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech debt rework due to choosing easy/limited solution Traffic Ops related to Traffic Ops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite /cdns/{{name}}/health to Go Rewrite /cdns/health to Go
7 participants