-
Notifications
You must be signed in to change notification settings - Fork 2k
Migrate HTTP server to net/http #6248
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
Conversation
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
See dapr#6246 Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
|
||
statusCode := int(resp.Status().Code) | ||
|
||
// TODO @ItalyPaleAle: Make this the only path once streaming is finalized | ||
if a.isStreamingEnabled { |
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.
Reviewers: this was removed for now since it's not effective (see #6246 )
} | ||
|
||
func (s *server) useCors(next fasthttp.RequestHandler) fasthttp.RequestHandler { | ||
func (s *server) useCors(next http.Handler) http.Handler { | ||
// TODO: Technically, if "AllowedOrigins" is "*", all origins should be allowed |
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.
Reviewers: Dapr is likely behaving incorrectly here. Setting *
in CORS should mean "allow all origins", but Dapr <=1.10 was actually omitting the CORS headers entirely. Since this is a backwards-incompatible change, I am not touching it now.
Codecov Report
@@ Coverage Diff @@
## master #6248 +/- ##
==========================================
+ Coverage 65.80% 65.84% +0.04%
==========================================
Files 194 195 +1
Lines 18995 19021 +26
==========================================
+ Hits 12499 12524 +25
+ Misses 5487 5480 -7
- Partials 1009 1017 +8
|
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
/ok-to-test |
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
/ok-to-perf |
Dapr perf testCommit ref: 947ec61 ✅ Build succeeded
✅ Infrastructure deployed
✅ Perf tests succeeded
|
Long have we waited for this change... Very curious about the perf results |
@yaron2 all perf tests are passing, and looks like perf may actually be improving Looking at the service invocation perf test (which is particularly useful here as it is among those more sensitive to the web server's own perf):
Three recent perf tests from master (1 2 3)
|
/ok-to-perf |
Dapr perf testCommit ref: e6e4cbd ✅ Build succeeded
✅ Infrastructure deployed
✅ Perf tests succeeded
|
Dapr perf testCommit ref: e6e4cbd ✅ Build succeeded
✅ Infrastructure deployed
✅ Perf tests succeeded
|
Dapr perf testCommit ref: e6e4cbd ✅ Build succeeded
✅ Infrastructure deployed
✅ Perf tests succeeded
|
/test-sdk-all |
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
/test-sdk-all |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
/ok-to-test |
/test-sdk-all |
Dapr SDK Python testCommit ref: d150ce1 ✅ Python SDK tests passed |
Dapr SDK Java testCommit ref: d150ce1 ✅ Java SDK tests passed |
Dapr E2E testCommit ref: d150ce1 ✅ Build succeeded for linux/arm64
✅ Infrastructure deployed
✅ Build succeeded for linux/amd64
✅ Build succeeded for windows/amd64
|
Dapr SDK JS testCommit ref: d150ce1 ✅ JS SDK tests passed |
Fixed all the issues reported by the SDK tests:
|
ServiceInvocationStreaming
isn't effective in responses from service invocation #6246This PR changes the HTTP server's listeners from fasthttp to net/http and fixes (or enables fixing) a lot of the scenarios that are blocked by #4979. Immediately, this should enable the web server to use HTTP/2 when TLS is enabled.
Included and not included
What this PR includes:
What this PR does NOT include:
pkg/http
still use fasthttp to create the test server. This isn't a concern at least until the handlers are migrated, but it should be changed in the future.All features continue to work as expected, as testified by the fact that tests have not changed. Only one exception to this rule is that when performing HTTP->gRPC invocations, the "dapr-host" metadata is not included anymore (this is probably ok also because HTTP->gRPC service invocation is being deprecated)
Next steps