Skip to content

Add Shutdown method to registry.Registry - #4338

Merged
milosgajdos merged 1 commit into
distribution:mainfrom
robinkb:public-shutdown
May 1, 2024
Merged

milosgajdos merged 1 commit into
distribution:mainfrom
robinkb:public-shutdown

Conversation

@robinkb

@robinkb robinkb commented Apr 28, 2024 •

Copy link
Copy Markdown
Contributor

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

Closes #4337.

@robinkb

robinkb commented Apr 28, 2024

Copy link
Copy Markdown
Contributor Author

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

@milosgajdos milosgajdos left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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

Comment thread registry/registry.go Outdated
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
Copy Markdown
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
Copy Markdown
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.

@robinkb

robinkb commented Apr 29, 2024

Copy link
Copy Markdown
Contributor Author

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

@Jamstah Jamstah left a comment

Copy link
Copy Markdown
Collaborator

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