-
Notifications
You must be signed in to change notification settings - Fork 41
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
The server now speaks non-ws NDT with JSON messages. #52
Conversation
Pull Request Test Coverage Report for Build 323
💛 - Coveralls |
It seems regress tests are failing because of:
That is, the legacy client is missing. We probably don't want to compile it as part of this repository testing process. Maybe we can store it as a binary asset to download for travis? (If this PR is still WIP, as you asked for no reviewers, please disregard :-) |
Still WIP When it becomes reviewable, it will have reviewers assigned. :) |
The command-line client doesn't work - it fails at the NDT handshake. I do not (yet) know why.
We need to put in some metrics gathering.
e5babda
to
fb36134
Compare
// is okay to break them. | ||
ws.DrainUntil(time.Now().Add(5 * time.Second)) | ||
ws.Close() | ||
}() |
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.
👍
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.
My primary concerns are with the ramifications of the raw-to-ws pass through on performance, data collection, and monitoring.
Reviewed 2 of 10 files at r1.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @pboothe and @stephen-soltesz)
ndt-server.go, line 135 at r1 (raw file):
// The legacy protocol serving non-HTTP-based tests - forwards to WS-based // server if the first three bytes are "GET". legacyRawServer := legacy.BasicServer{
There is a lot going on in setup; we're starting 5 services.
I like the flag naming convention you've adopted, i.e. "legacy, legacy_ws, legacy_wss". The variables below do not follow this consistently. For example, it's hard to tell that "legacyServer" below is actually the setup for the "legacy_ws" port.
It looks like the legacy server is not instrumented with prometheus metrics. I think we will want to be able to measure how often the raw-to-ws proxy is operating.
TestDockerfile, line 2 at r1 (raw file):
FROM golang:1.11 as build COPY --from=pboothe/test-runner /ndt/src/web100clt /bin
This should not reference personal container images. How was pboothe/test-runner built? How can we rebuild it if needed? Can we include that docker file in the ndt-server also?
legacy/testrunner.go, line 151 at r1 (raw file):
} if string(lead) == "GET" { // Forward HTTP-like handshakes to the HTTP server. Note that this does NOT
Please ensure that we can count the relative frequency of 3001-raw vs 3001-ws clients using prometheus metrics.
If we never expect direct connections to 3002 then we could use the difference between connections to 3001 - connections to 3002 using the http handler instruments.
legacy/testrunner.go, line 155 at r1 (raw file):
// HTTP server itself opens the testing port, and that server will not use // this TCP proxy. fwd, err := net.Dial("tcp", s.HTTPAddr)
Is it too late in the protocol negotiation to issue a 301 Redirect?
legacy/testrunner.go, line 164 at r1 (raw file):
// Copy the input channel. go func() { io.Copy(fwd, input)
What impact on performance does this have?
Does this mean tcpinfo will collect two traces?
legacy/protocol/protocol.go, line 180 at r1 (raw file):
} if MessageType(inbuff[0]) != expectedType { return nil, fmt.Errorf("Read wrong message type. Wanted %s, got %s", expectedType, MessageType(inbuff[0]))
%q
?
legacy/s2c/s2c.go, line 25 at r1 (raw file):
// Result is the result object returned to S2C clients as JSON. type Result struct { ThroughputValue string
Were the types here totally wrong before? This change must impact clients that parse the value, no? A rate in json quotes is very different from not.
legacy/s2c/s2c.go, line 133 at r1 (raw file):
} protocol.SendJSONMessage(protocol.TestFinalize, "", ws) r.Response <- 0.0
Please add comment that this is telling the client thread to shutdown. Maybe a constant like testresponder.Shutdown
?
legacy/testresponder/testresponder.go, line 28 at r1 (raw file):
const ( // RawNoJSON NDT tests correspond to the code integrated into the uTorrent client. RawNoJSON = ServerType(iota)
RawNoJSON is not used anywhere, is that expected?
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.
Performance isn't an issue - only the control channel is a pass-through. Data collection is a mild irritation - tcp-info
will generate two traces for passed-through connections (but again, that's only the control channel so it's okay). Monitoring is a thing I would like to talk more about, probably in person.
Initial comments below. No need to respond yet.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @pboothe and @stephen-soltesz)
TestDockerfile, line 2 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
This should not reference personal container images. How was pboothe/test-runner built? How can we rebuild it if needed? Can we include that docker file in the ndt-server also?
Dockerizing old versions of web100clt
seems like potentially a lot of work. I'll double-check this to see, but I am worried.
legacy/testrunner.go, line 155 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
Is it too late in the protocol negotiation to issue a 301 Redirect?
Interesting idea. I will see.
legacy/testrunner.go, line 164 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
What impact on performance does this have?
Does this mean tcpinfo will collect two traces?
None (the control channel has minimal performance requirements) and yes, but only for the control channel, which is not the connection over which measurements take place.
legacy/testresponder/testresponder.go, line 28 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
RawNoJSON is not used anywhere, is that expected?
Yes. It is the next server type I have to implement and the last NDT client type that exists in the wild. It is the client type for uTorrent. But the current PR felt like enough of a change that i wanted to stop here and get a review.
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.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @pboothe and @stephen-soltesz)
TestDockerfile, line 2 at r1 (raw file):
Previously, pboothe (Peter Boothe) wrote…
Dockerizing old versions of
web100clt
seems like potentially a lot of work. I'll double-check this to see, but I am worried.
As you can see, it sucked and I did it. :P
Add libraries back into the docker image
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.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @bassosimone, @pboothe, and @stephen-soltesz)
TestDockerfile, line 2 at r1 (raw file):
Previously, pboothe (Peter Boothe) wrote…
As you can see, it sucked and I did it. :P
Done.
legacy/testrunner.go, line 164 at r1 (raw file):
Previously, pboothe (Peter Boothe) wrote…
None (the control channel has minimal performance requirements) and yes, but only for the control channel, which is not the connection over which measurements take place.
Done.
legacy/c2s/c2s.go, line 43 at r1 (raw file):
Previously, bassosimone (Simone Basso) wrote…
👍
Done.
legacy/protocol/protocol.go, line 180 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
%q
?
Done.
legacy/s2c/s2c.go, line 133 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
Please add comment that this is telling the client thread to shutdown. Maybe a constant like
testresponder.Shutdown
?
Changed to close()
legacy/s2c/s2c.go, line 25 at r1 (raw file): Previously, stephen-soltesz (Stephen Soltesz) wrote…
The types were wrong before. The old server code to generate the JSON is: https://github.com/m-lab/ndt/blob/master/src/test_s2c_srv.c#L625 It turns out that the |
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.
PTAL
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @bassosimone, @pboothe, and @stephen-soltesz)
ndt-server.go, line 135 at r1 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
There is a lot going on in setup; we're starting 5 services.
I like the flag naming convention you've adopted, i.e. "legacy, legacy_ws, legacy_wss". The variables below do not follow this consistently. For example, it's hard to tell that "legacyServer" below is actually the setup for the "legacy_ws" port.
It looks like the legacy server is not instrumented with prometheus metrics. I think we will want to be able to measure how often the raw-to-ws proxy is operating.
Done and done.
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.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @bassosimone)
TestDockerfile, line 2 at r1 (raw file):
Previously, pboothe (Peter Boothe) wrote…
Done.
Thank you. This is much better.
legacy/s2c/s2c.go, line 133 at r1 (raw file):
Previously, pboothe (Peter Boothe) wrote…
Changed to
close()
Even better.
legacy/testrunner.go, line 155 at r1 (raw file):
Previously, pboothe (Peter Boothe) wrote…
Interesting idea. I will see.
We discussed offline that while redirect might be the "right thing" we're doing this at all to support legacy clients, which evidently, may not all support redirection [which is ridiculous]. And, we would only ever consider doing something like this for the legacy protocol.
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.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @bassosimone and @pboothe)
ndt-server_test.go, line 154 at r2 (raw file):
}{ // Test legacy raw JSON clients {
Please add TODO for web100clt-without-json-support
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.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @bassosimone and @stephen-soltesz)
ndt-server_test.go, line 154 at r2 (raw file):
Previously, stephen-soltesz (Stephen Soltesz) wrote…
Please add TODO for
web100clt-without-json-support
Done.
This change is