-
Notifications
You must be signed in to change notification settings - Fork 84
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
Ensure Introspection endpoints are always available #755
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #755 +/- ##
==========================================
+ Coverage 87.62% 88.67% +1.04%
==========================================
Files 40 40
Lines 4090 4096 +6
==========================================
+ Hits 3584 3632 +48
+ Misses 389 352 -37
+ Partials 117 112 -5
Continue to review full report at Codecov.
|
subchannel_test.go
Outdated
@@ -195,8 +195,7 @@ func TestGetHandlers(t *testing.T) { | |||
}{ | |||
{ | |||
serviceName: ch.ServiceName(), | |||
// Default service name comes with extra introspection methods. | |||
wantMethods: []string{"_gometa_introspect", "_gometa_runtime", "method1", "method2"}, | |||
wantMethods: []string{"method1", "method2"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm this removal: before we registered both introspection and actual procedure together. Now we don't and those introspection are not visible anymore during actual handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep exactly. They're no longer just "user-level" methods, but internal methods that are always registered at a higher layer, so they don't show up here anymore.
Currently, introspection endpoints only work if the service doesn't use SetHandler to completely take over the procedure->handler mapping, and if the caller uses either the service name of the channel or "tchannel" to hit the introspection endpoints. Instead, let's always handle introspection first regardless of the service name. The test added panics without this change, ``` === RUN TestIntrospectionNotBlocked === RUN TestIntrospectionNotBlocked/no_relay panic: should not be called goroutine 20 [running]: github.com/uber/tchannel-go_test.TestIntrospectionNotBlocked.func1.1(0xa498c0, 0xc000152070, 0xc0001da000) /home/prashant/go/src/github.com/uber/tchannel-go/introspection_test.go:125 ```
7996f09
to
6a60a55
Compare
Currently, introspection endpoints only work if the service doesn't use
SetHandler to completely take over the procedure->handler mapping, and
if the caller uses either the service name of the channel or "tchannel"
to hit the introspection endpoints.
Instead, let's always handle introspection first for the "tchannel" service. This
cannot be overridden, and no other service names work for introspection.
The test added panics without this change,