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

Hystrix 1.4 - Async/Non-Blocking #218

Merged
merged 39 commits into from
Mar 11, 2014
Merged

Hystrix 1.4 - Async/Non-Blocking #218

merged 39 commits into from
Mar 11, 2014

Conversation

benjchristensen
Copy link
Contributor

This adds support for async/non-blocking sources via the new HystrixObservableCommand. It also changes HystrixCommand to use HystrixObservableCommand so all functionality goes through the same code path.

This achieves the "Asynchronous Executables" feature in #11

Further information and documentation will be written for the release notes.

This code has been running on a single instance in production for a few days at Netflix so appears good enough to release as beta or release candidate. The intent is to allow a week or two of production testing at Netflix before providing an official 1.4.0 release.

neerajrj and others added 30 commits February 11, 2014 20:14
- updated unit test that no longer worked with new Scheduler implementation
- they have outgrown the inner class model
- I have made many things package accessible to make tests work
- several are still breaking because they are accessing private members and I have not decided how to handle them
- all unit tests compiling
-  not all are passing as the RxJava 0.17 upgrade is still in process
RxJava 0.17 handles synchronous Subscriptions now so this code needed to be changed otherwise the exceptions never got thrown since the isUnsubscribed() would already be true.
Deriving the full class names for these inner classes was being done wrong and resulted in bad class names when the unit tests got moved.
This reveals the bugs in the current HystrixNonBlockingCommand implementation.
- unit tests are all passing with both async and sync Observables
- defaults to semaphore isolation but allows thread isolation if an Observable source is synchronous
- Use "Operator" name as that's what it is.
- Use HystrixObservableTimeoutOperator instead of TimeoutOperator so in a stacktrace it's clear it's the Hystrix variant and not the normal RxJava TimeoutOperator.
- all unit tests are now passing with semaphore and thread isolation
Update tests to assert isExecutedInThread true/false so we are sure the tests are getting what they expect.
Eliminate the AbstractHystrixCommand inheritance.
... breaks things (thought nothing would implement this interface, but alas some things do).
Fixes issue reported in #212
This was also fixed in 1.3.10
…-merge

Conflicts:
	hystrix-core/build.gradle
	hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapser.java
	hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommand.java
	hystrix-core/src/main/java/com/netflix/hystrix/strategy/HystrixPlugins.java
	hystrix-core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixConcurrencyStrategy.java
	hystrix-core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixContexSchedulerAction.java
	hystrix-core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixContextCallable.java
	hystrix-core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixContextRunnable.java
	hystrix-core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixContextScheduler.java
Wait until onComplete before emitting the results so that all metrics, event logs, etc are done.
benjchristensen added a commit that referenced this pull request Mar 11, 2014
@benjchristensen benjchristensen merged commit 2118664 into Netflix:master Mar 11, 2014
@benjchristensen benjchristensen deleted the hystrix-1-4-non-blocking-merge branch March 11, 2014 05:00
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.

2 participants