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

[feature] When the nacos-server fails to start, shutdown all http clients #3832

Closed
Maijh97 opened this issue Sep 15, 2020 · 4 comments
Closed

[feature] When the nacos-server fails to start, shutdown all http clients #3832

Maijh97 opened this issue Sep 15, 2020 · 4 comments

Comments

@Maijh97
Copy link
Collaborator

@Maijh97 Maijh97 commented Sep 15, 2020

Is your feature request related to a problem? Please describe.
When nacos-server fails to start, the http client should be shut down to release related resources.

Describe the solution you'd like

  1. Add the shutdown all http client method in HttpClientBeanHolder.

  2. Call HttpClientBeanHolder#shutdown in the StartingSpringApplicationRunListener#failed method to shut down all http clients.

Describe alternatives you've considered

Additional context

@Maijh97
Copy link
Collaborator Author

@Maijh97 Maijh97 commented Nov 3, 2020

Considering that when the server fails to start, it usually stops the current service and restarts it. Currently, the http client uses ThreadUtils#addShutdownHook to close, so there is no need to add the http client shutdown method in StartingSpringApplicationRunListener#failed.

Loading

@Maijh97 Maijh97 closed this Nov 3, 2020
@Maijh97
Copy link
Collaborator Author

@Maijh97 Maijh97 commented Nov 4, 2020

Because there is a shared http client implementation, it is still necessary to supplement the shared http client shutdown.

Loading

@KomachiSion
Copy link
Collaborator

@KomachiSion KomachiSion commented Nov 6, 2020

Has this issue completed? If so, close it.

Loading

@KomachiSion KomachiSion added this to the 1.4.1 milestone Nov 6, 2020
@Maijh97 Maijh97 linked a pull request that will close this issue Nov 6, 2020
5 tasks
@Maijh97
Copy link
Collaborator Author

@Maijh97 Maijh97 commented Nov 6, 2020

Has this issue completed? If so, close it.

Resolved

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants