-
Notifications
You must be signed in to change notification settings - Fork 43
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
Stats endpoint API should shut down cleanly #107
Labels
Team:Elastic-Agent
Label for the Agent team
Team:Elastic-Agent-Control-Plane
Label for the Agent Control Plane team
Comments
elastic-agent-libs/api/server.go Lines 66 to 79 in 3fd7788
Seems be because we pass a net.Listener to the default http.Server, instead of creating a server and calling close on the server, which would let us check for // Serve accepts incoming HTTP connections on the listener l,
// creating a new service goroutine for each. The service goroutines
// read requests and then call handler to reply to them.
//
// The handler is typically nil, in which case the DefaultServeMux is used.
//
// HTTP/2 support is only enabled if the Listener returns *tls.Conn
// connections and they were configured with "h2" in the TLS
// Config.NextProtos.
//
// Serve always returns a non-nil error.
func Serve(l net.Listener, handler Handler) error {
srv := &Server{Handler: handler}
return srv.Serve(l)
} |
fyi i added #168 to expose shutdown to the caller |
ycombinator
added
the
Team:Elastic-Agent-Control-Plane
Label for the Agent Control Plane team
label
May 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Team:Elastic-Agent
Label for the Agent team
Team:Elastic-Agent-Control-Plane
Label for the Agent Control Plane team
cc @cmacknz
In cases where agent is shut down cleanly (for example, with a sigint), we get this message:
This is a benign error, but it's almost always the last message we get when agent shuts down, which means users might get confused and assume it's somehow related to the shutdown. We should either clarify the error message to make it sound less threatening, or change the
(s *Server) Stop()
method so we don't print an error during "normal" shutdown.The text was updated successfully, but these errors were encountered: