-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Handle ports > 32k in Zipkin JSON #488
Conversation
Signed-off-by: Yuri Shkuro <[email protected]>
deadline := time.Now().Add(2 * time.Second) | ||
for { | ||
if time.Now().After(deadline) { | ||
t.Error("never received a span") | ||
return | ||
} | ||
if want, have := 1, len(handler.zipkinSpansHandler.(*mockZipkinHandler).getSpans()); want != have { | ||
if want, have := expecting, len(handler.getSpans()); want != have { |
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.
is "want" necessary? just do
if have := ....; expected != have {
cmd/collector/app/zipkin/json.go
Outdated
@@ -147,10 +147,15 @@ func endpointToThrift(e endpoint) (*zipkincore.Endpoint, error) { | |||
if err != nil { | |||
return nil, err | |||
} | |||
port := e.Port | |||
if port >= (1 << 15) { | |||
// Zipkin.thrift defines port as i16, so values between (2^16 and 2^16-1) must be encoded as negative |
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.
2^15 and 2^16-1?
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.
what's the question?
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.
oh, yeah
Signed-off-by: Yuri Shkuro <[email protected]>
Resolves #467