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

Concurrent register of custom healthcheck handler in DiscoveryClient #1088

Conversation

tdanylchuk
Copy link
Contributor

Some clients try to register their health checks and fail since there is possibility to rewrite healthcheck handler by default one.

Root cause:
after not thread safe null check DiscoveryClient will register default healthcheck handler even if during creation of that, custom one will be provided.
Resolution summary:
wrap healthcheck handler in AtomicReference and set default implementation only if reference still contain null.

Example is spring-cloud-netflix project and spring-cloud/spring-cloud-netflix#2490 issue.

… is possibility to rewrite healthcheck handler by default one.

Root cause:
after not thread safe null check DiscoveryClient will register default healthcheck handler even if during creation of that, custom one will be provided.
Resolution summary:
wrap healthcheck handler in AtomicReference and set default implementation only if reference still contain null
@qiangdavidliu
Copy link
Contributor

@tdanylchuk looks good, thanks for the contribution.

@qiangdavidliu qiangdavidliu merged commit ac6bd9b into Netflix:master Jun 25, 2018
@tdanylchuk tdanylchuk deleted the fix-healthcheck-handler-concurrent-register branch June 26, 2018 07:36
@tdanylchuk
Copy link
Contributor Author

tdanylchuk commented Jun 26, 2018

My pleasure, thank you for supporting the project.

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.

None yet

2 participants