{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/955","labels_url":"https://api.github.com/repos/Netflix/Hystrix/issues/955/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/Hystrix/issues/955/comments","events_url":"https://api.github.com/repos/Netflix/Hystrix/issues/955/events","html_url":"https://github.com/Netflix/Hystrix/issues/955","id":112519581,"number":955,"title":"HystrixCollapser completes without emitting","user":{"login":"amitcse","id":431013,"avatar_url":"https://avatars.githubusercontent.com/u/431013?v=3","gravatar_id":"","url":"https://api.github.com/users/amitcse","html_url":"https://github.com/amitcse","followers_url":"https://api.github.com/users/amitcse/followers","following_url":"https://api.github.com/users/amitcse/following{/other_user}","gists_url":"https://api.github.com/users/amitcse/gists{/gist_id}","starred_url":"https://api.github.com/users/amitcse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitcse/subscriptions","organizations_url":"https://api.github.com/users/amitcse/orgs","repos_url":"https://api.github.com/users/amitcse/repos","events_url":"https://api.github.com/users/amitcse/events{/privacy}","received_events_url":"https://api.github.com/users/amitcse/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Netflix/Hystrix/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Netflix/Hystrix/labels/hystrix-core","name":"hystrix-core","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-10-21T06:12:12Z","updated_at":"2015-11-23T06:57:49Z","closed_at":null,"body":"Hi, I am facing a weird issue wherein the observable returned by `HystrixCollapser` completes without emitting any item. Since I am using `HystrixCollapser.toObservable()` inside to do composition using RxJava operator, this is leading to items being missed from the data flow. \r\nOn debugging I have found that the `HystrixCollapser` do call the `HystrixCommand.run()` and `mapResponsetoRequests` function is also called. \r\nI am unable to debug this more because this behaviour is completely random. \r\n\r\nFor reference, my rx observable composition is something like this,\r\n```\r\nObservable.from(id1, id2, id3, ....)\r\n.flatMap(id -> collapser1(id))\r\n.flatMap(collapser1Result -> {\r\n    collapser2Observable = collapser2(collapser1Result);\r\n    collapser3Observable = collapser3(collapser1Result);\r\n    collapser4Observable = collapser4(collapser1Result);\r\n\r\n    return Observable.zip(collapser2Observable, collapser3Observable, collapser4Observable, \r\n        (collapser2Res, collapser3Res, collapser4Res) \r\n                    -> makeFinalResult(collapser2Res, collapser3Res, collapser4Res));\r\n})\r\n.map(finalResult -> doSomeTransformations(finalResult))\r\n.toList().toBlocking().single();\r\n```\r\nSince any of collapser2/3/4 completes without emitting, this lead to zip being called and corresponding related result goes missing from the final list.\r\n"},"comment":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/comments/158863974","html_url":"https://github.com/Netflix/Hystrix/issues/955#issuecomment-158863974","issue_url":"https://api.github.com/repos/Netflix/Hystrix/issues/955","id":158863974,"user":{"login":"amitcse","id":431013,"avatar_url":"https://avatars.githubusercontent.com/u/431013?v=3","gravatar_id":"","url":"https://api.github.com/users/amitcse","html_url":"https://github.com/amitcse","followers_url":"https://api.github.com/users/amitcse/followers","following_url":"https://api.github.com/users/amitcse/following{/other_user}","gists_url":"https://api.github.com/users/amitcse/gists{/gist_id}","starred_url":"https://api.github.com/users/amitcse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitcse/subscriptions","organizations_url":"https://api.github.com/users/amitcse/orgs","repos_url":"https://api.github.com/users/amitcse/repos","events_url":"https://api.github.com/users/amitcse/events{/privacy}","received_events_url":"https://api.github.com/users/amitcse/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T06:57:49Z","updated_at":"2015-11-23T06:57:49Z","body":"Thanks @mattrjacobs for the test. I ran the test for 50000 trials with `m=10, n=5` and was able to reproduce on trial 943. Take a look at the trace. This is the same issue I am facing.\r\n\r\n```\r\nTRIAL : 942\r\nRunnable done on thread : pool-943-thread-8\r\nRunnable done on thread : pool-943-thread-1\r\nRunnable done on thread : pool-943-thread-3\r\nRunnable done on thread : pool-943-thread-7\r\nRunnable done on thread : pool-943-thread-6\r\nRunnable done on thread : pool-943-thread-2\r\nRunnable done on thread : pool-943-thread-4\r\nRunnable done on thread : pool-943-thread-9\r\nRunnable done on thread : pool-943-thread-10\r\nRunnable done on thread : pool-943-thread-5\r\nReceived : [0:0]\r\nReceived : [7:7]\r\nReceived : [9:9]\r\nReceived : [10:10]\r\nReceived : [11:11]\r\nReceived : [5:5]\r\nReceived : [3:3]\r\nReceived : [14:14]\r\nReceived : [6:6]\r\nReceived : [12:12]\r\nReceived : [1:1]\r\nReceived : [13:13]\r\nReceived : [19:19]\r\nReceived : [4:4]\r\nReceived : [2:2]\r\nReceived : [16:16]\r\nReceived : [17:17]\r\nReceived : [25:25]\r\nReceived : [15:15]\r\nReceived : [26:26]\r\nReceived : [27:27]\r\nReceived : [20:20]\r\nReceived : [21:21]\r\nReceived : [22:22]\r\nReceived : [23:23]\r\nReceived : [31:31]\r\nReceived : [30:30]\r\nReceived : [24:24]\r\nReceived : [18:18]\r\nReceived : [28:28]\r\nReceived : [34:34]\r\nReceived : [35:35]\r\nReceived : [33:33]\r\nReceived : [36:36]\r\nReceived : [39:39]\r\nReceived : [41:41]\r\nReceived : [37:37]\r\nReceived : [29:29]\r\nReceived : [43:43]\r\nReceived : [44:44]\r\nReceived : [38:38]\r\nReceived : [42:42]\r\nReceived : [8:8]\r\nReceived : [45:45]\r\nReceived : [46:46]\r\nReceived : [47:47]\r\nReceived : [48:48]\r\nReceived : [40:40]\r\nReceived : [32:32]\r\nReceived : [49:49]\r\nTRIAL : 943\r\nRunnable done on thread : pool-944-thread-4\r\nRunnable done on thread : pool-944-thread-2\r\nRunnable done on thread : pool-944-thread-5\r\nRunnable done on thread : pool-944-thread-1\r\nRunnable done on thread : pool-944-thread-7\r\nRunnable done on thread : pool-944-thread-10\r\nRunnable done on thread : pool-944-thread-3\r\nRunnable done on thread : pool-944-thread-9\r\nRunnable done on thread : pool-944-thread-8\r\nRunnable done on thread : pool-944-thread-6\r\nReceived : []\r\n\r\nNumber of onNext events differ; expected: 1, actual: 0\r\njava.lang.AssertionError: Number of onNext events differ; expected: 1, actual: 0\r\n\tat rx.observers.TestSubscriber.assertValueCount(TestSubscriber.java:479)\r\n\tat com.netflix.hystrix.HystrixObservableCollapserTest.testCollapserUnderConcurrency(HystrixObservableCollapserTest.java:625)\r\n\tat com.netflix.hystrix.HystrixObservableCollapserTest.testConcurrencyInTightLoop(HystrixObservableCollapserTest.java:636)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)\r\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)\r\n\tat org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)\r\n\tat org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)\r\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:300)\r\n\tat org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:105)\r\n\tat org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:56)\r\n\tat org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:64)\r\n\tat org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:50)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)\r\n\tat org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)\r\n\tat org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)\r\n\tat org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)\r\n\tat com.sun.proxy.$Proxy2.processTestClass(Unknown Source)\r\n\tat org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:106)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)\r\n\tat org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)\r\n\tat org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)\r\n\tat org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)\r\n\tat org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n\r\n"}}