Skip to content

Commit

Permalink
add comments for readability
Browse files Browse the repository at this point in the history
Signed-off-by: Abhilash Gnan <abhilashgnan@gmail.com>
  • Loading branch information
jan25 committed Jun 14, 2019
1 parent 853ad5d commit 3b6a3d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cmd/flags/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ func (s *AdminServer) serveWithListener(l net.Listener) {
s.server = &http.Server{Handler: recoveryHandler(s.mux)}
s.logger.Info("Starting admin HTTP server", zap.Int("http-port", s.adminPort))
go func() {
err := s.server.Serve(l)
if err != nil && err != http.ErrServerClosed {
switch err := s.server.Serve(l); err {
case nil, http.ErrServerClosed:
// normal exit, nothing to do
default:
s.logger.Error("failed to serve", zap.Error(err))
s.hc.Set(healthcheck.Broken)
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/query/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func (s *Server) Start() error {

switch err := s.httpServer.Serve(httpListener); err {
case nil, http.ErrServerClosed, cmux.ErrListenerClosed:
// normal exit, nothing to do
default:
s.svc.Logger.Error("Could not start HTTP server", zap.Error(err))
}
Expand All @@ -118,6 +119,7 @@ func (s *Server) Start() error {
// Start GRPC server concurrently
go func() {
s.svc.Logger.Info("Starting GRPC server", zap.Int("port", s.queryOptions.Port))

if err := s.grpcServer.Serve(grpcListener); err != nil {
s.svc.Logger.Error("Could not start GRPC server", zap.Error(err))
}
Expand All @@ -129,6 +131,7 @@ func (s *Server) Start() error {
s.svc.Logger.Info("Starting CMUX server", zap.Int("port", s.queryOptions.Port))

err := cmuxServer.Serve()
// TODO: Remove string comparision when https://github.com/soheilhy/cmux/pull/69 is merged
if err != nil && !strings.Contains(err.Error(), "use of closed network connection") {
s.svc.Logger.Error("Could not start multiplexed server", zap.Error(err))
}
Expand Down
2 changes: 1 addition & 1 deletion jaeger-ui
Submodule jaeger-ui updated 308 files

0 comments on commit 3b6a3d2

Please sign in to comment.