Skip to content
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

Trident logs http: Server closed as a fatal error when it shutdowns #597

Closed
tksm opened this issue Jul 1, 2021 · 1 comment
Closed

Trident logs http: Server closed as a fatal error when it shutdowns #597

tksm opened this issue Jul 1, 2021 · 1 comment

Comments

@tksm
Copy link

tksm commented Jul 1, 2021

Describe the bug
Trident logs http: Server closed as a fatal error when it shutdowns.

time="2021-07-01T01:47:30Z" level=fatal msg="http: Server closed"

Tident components call func (*Server) Shutdown, so ErrServerClosed(http: Server closed) is returned in normal cases.

Environment

  • Trident version: 21.04.1
  • Trident installation flags used: silenceAutosupport: true (Trident Operator)
  • Container runtime: Docker 19.03.13
  • Kubernetes version: v1.19.11
  • Kubernetes orchestrator: Kubernetes
  • Kubernetes enabled feature gates:
  • OS: Ubuntu 18.04.5
  • NetApp backend types: ONTAP AFF 9.1P14
  • Other:

To Reproduce

  1. Watch the log of one trident-csi pod
    • e.g. kubectl logs -n trident --since 10s -f trident-csi-xxxx
  2. Delete the trident-csi pod
    • e.g. kubectl delete pod -n trident trident-csi-xxxx

Expected behavior
ErrServerClosed(http: Server closed) should be ignored like below. (ListenAndServe always returns a non-nil error.)

diff --git a/frontend/metrics/plugin.go b/frontend/metrics/plugin.go
index fd1562f..0c2a109 100644
--- a/frontend/metrics/plugin.go
+++ b/frontend/metrics/plugin.go
@@ -38,7 +38,7 @@ func (s *Server) Activate() error {
        go func() {
                log.WithField("address", s.server.Addr).Info("Activating metrics frontend.")
                http.Handle("/metrics", s.server.Handler)
-               if err := s.server.ListenAndServe(); err != nil {
+               if err := s.server.ListenAndServe(); err != http.ErrServerClosed {
                        log.Fatal(err)
                }
        }()
@tksm tksm added the bug label Jul 1, 2021
@gnarl gnarl added the tracked label Jul 1, 2021
@gnarl
Copy link
Contributor

gnarl commented Aug 21, 2021

This is fixed with commit ddddc0b and will be included in the Trident v21.10 release.

@gnarl gnarl closed this as completed Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants