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

Made HystrixTimer initialization thread-safe #203

Merged
merged 1 commit into from
Feb 7, 2014

Conversation

rocketraman
Copy link
Contributor

The current initialization in HystrixTimer is not thread-safe: one thread may create the ScheduledExecutor, but a second thread may try to use it before it has been initialized, resulting in a NullPointerException. This race is easy to replicate by starting multiple Threads that each run a HystrixCommand simultaneously.

This pull fixes this by looping on the appropriate initialization condition.

@cloudbees-pull-request-builder

Hystrix-pull-requests #63 SUCCESS
This pull request looks good

@rocketraman rocketraman mentioned this pull request Jan 23, 2014
@vadims
Copy link

vadims commented Jan 31, 2014

any chance this can be merged soon? we're seeing this frequently after the server starts

benjchristensen added a commit that referenced this pull request Feb 7, 2014
Made HystrixTimer initialization thread-safe
@benjchristensen benjchristensen merged commit 6435c7c into Netflix:master Feb 7, 2014
@benjchristensen
Copy link
Contributor

Thank you @vadims

About to release a maintenance release before the big changes of 1.4.

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.

4 participants