Skip to content

Conversation

robinkb
Copy link
Contributor

@robinkb robinkb commented Apr 28, 2024

Adds a Shutdown method to registry.Registry. Enables gracefully shutting down an embedded registry HTTP server.

Closes #4337.

@robinkb
Copy link
Contributor Author

robinkb commented Apr 28, 2024

Missed some really obvious things. Fixes are pushed, and my own fork is working nicely in my embedding app.

Copy link
Member

@milosgajdos milosgajdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason why we shouldn't accept this change. LGTM. PTAL @thaJeztah

@thaJeztah
Copy link
Member

Looks like there's some fix-up commits in the PR that should be squashed; can you clean up commit history a bit?

func (registry *Registry) Shutdown() error {
dcontext.GetLogger(registry.app).Info("stopping server gracefully. Draining connections for ", registry.config.HTTP.DrainTimeout)
// shutdown the server with a grace period of configured timeout
c, cancel := context.WithTimeout(context.Background(), registry.config.HTTP.DrainTimeout)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is new functionality; would it make sense to pass a context to the function; also to make it closer to the server.Shutdown() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified to function to accept a context instead of setting its own. Please take a look.

LabTopProductions

This comment was marked as spam.

Signed-off-by: Robin Ketelbuters <robin.ketelbuters@gmail.com>
@robinkb
Copy link
Contributor Author

robinkb commented Apr 29, 2024

Looks like there's some fix-up commits in the PR that should be squashed; can you clean up commit history a bit?

Sorry, I'm used to squashing my PRs. I just did so.

@milosgajdos milosgajdos requested a review from thaJeztah April 29, 2024 18:31
@milosgajdos milosgajdos dismissed LabTopProductions’s stale review April 30, 2024 07:28

Stop spamming this repo

nawfg214 referenced this pull request Apr 30, 2024
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Copy link
Collaborator

@Jamstah Jamstah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@milosgajdos milosgajdos merged commit c8e22f6 into distribution:main May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Shutdown() method on registry.Registry struct
5 participants