-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Move all query service HTTP handlers into one function #6128
Conversation
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6128 +/- ##
==========================================
+ Coverage 96.41% 96.43% +0.01%
==========================================
Files 353 353
Lines 20137 20135 -2
==========================================
+ Hits 19416 19417 +1
+ Misses 535 533 -2
+ Partials 186 185 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yuri Shkuro <[email protected]>
@mahadzaryab1 please 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.
lgtm
} | ||
|
||
if queryOpts.HTTP.TLSSetting != nil { | ||
tlsCfg, err := queryOpts.HTTP.TLSSetting.LoadTLSConfig(ctx) // This checks if the certificates are correctly provided | ||
if err != nil { | ||
return nil, err | ||
return nil, errors.Join(err, staticHandlerCloser.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.
ah that's why I was seeing the goleak errors - need to close the handler before exiting
@@ -203,14 +203,13 @@ type httpServer struct { | |||
|
|||
var _ io.Closer = (*httpServer)(nil) | |||
|
|||
func createHTTPServer( | |||
ctx context.Context, | |||
func initRouter( |
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.
will it be okay to have redundant handlers with the otel implementation? specifically asking about the response headers handler and the compression handler.
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.
yes
Signed-off-by: Yuri Shkuro <[email protected]>
…rtracing#6128)" This reverts commit bf06acf.
Which problem is this PR solving?
Description of the changes
initRouter
How was this change tested?
go test ./cmd/query/app/...