Skip to content

registryctl logs http: Server closed as fatal during graceful shutdown #23294

@rakshityadav1868

Description

@rakshityadav1868

Issue Title

registryctl logs http: Server closed as fatal during graceful shutdown

Description

Summary

registryctl logs a fatal error during normal graceful shutdown:

However, this is caused by http.ErrServerClosed, which is expected behavior when the HTTP server shuts down gracefully.

Current Behavior

In RegistryCtl.Start():

err = regCtl.ListenAndServe()
...
if err != nil { log.Fatal(err) }

ListenAndServe() returns http.ErrServerClosed after a successful shutdown, causing Harbor to incorrectly emit a fatal log.

Expected Behavior

Graceful shutdown should not produce fatal logs.

http.ErrServerClosed should be ignored explicitly.

Result

After applying the fix:

  • graceful shutdown logs are clean
  • no misleading fatal message appears
  • shutdown behavior remains unchanged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions