{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/752","labels_url":"https://api.github.com/repos/Netflix/Hystrix/issues/752/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/Hystrix/issues/752/comments","events_url":"https://api.github.com/repos/Netflix/Hystrix/issues/752/events","html_url":"https://github.com/Netflix/Hystrix/issues/752","id":68120552,"number":752,"title":"API call times out inside flatMap.","user":{"login":"sagarrao","id":1764575,"avatar_url":"https://avatars.githubusercontent.com/u/1764575?v=3","gravatar_id":"","url":"https://api.github.com/users/sagarrao","html_url":"https://github.com/sagarrao","followers_url":"https://api.github.com/users/sagarrao/followers","following_url":"https://api.github.com/users/sagarrao/following{/other_user}","gists_url":"https://api.github.com/users/sagarrao/gists{/gist_id}","starred_url":"https://api.github.com/users/sagarrao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagarrao/subscriptions","organizations_url":"https://api.github.com/users/sagarrao/orgs","repos_url":"https://api.github.com/users/sagarrao/repos","events_url":"https://api.github.com/users/sagarrao/events{/privacy}","received_events_url":"https://api.github.com/users/sagarrao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-13T15:04:37Z","updated_at":"2015-04-14T15:35:13Z","closed_at":null,"body":"I am experiencing a weird issue while using flatMap for chaining API calls.\r\n\r\nThe idea is, we hit a URL which returns a list of users. The users would be returned in this form:\r\n\r\nusers: [\r\n{\r\nuser: \"aaa@bbb.com\"\r\n},\r\n{\r\nuser: \"ccc@bbb.com\"\r\n}].\r\n\r\nThen using StringObservable,  this inputs are split on the \":\", and another java split on \"\\\"(defined in fetchUserFromDetails)  the individual e-mail ids are extracted. \r\n\r\nThen, the problem area starts. Once, the individual e-mail ids are extreacted, they are used to hit another API to get that user specific data. But, strangely, this call always returns a timeout. \r\n\r\n\r\nStringObservable.split(StringObservable.from(firstCall(url,\tfalse)), \":\")\r\n\t\t\t\t.flatMap(this::fetchUserFromDetails)\r\n\t\t\t\t.flatMap(user -> Observable.just(secondCall(USER_DETAIL_FETCH_URL + user, false)))\r\n\r\nThe second call when hit on the browser returns almost immediately. This is what the logs say:\r\n\r\nElapsed Time in api call  is 16723 ms #the first call\r\nException happened.Inside Fallback\r\nDid the response timeouttrue\r\nElapsed Time in api call  is 2444 ms #second call\r\n\r\nThe second call timesout even though it takes almost 1/10th the lesser time. I haven't configured any timeouts as such anywhere. What exactly can go wrong here?"},"comment":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/comments/92913356","html_url":"https://github.com/Netflix/Hystrix/issues/752#issuecomment-92913356","issue_url":"https://api.github.com/repos/Netflix/Hystrix/issues/752","id":92913356,"user":{"login":"sagarrao","id":1764575,"avatar_url":"https://avatars.githubusercontent.com/u/1764575?v=3","gravatar_id":"","url":"https://api.github.com/users/sagarrao","html_url":"https://github.com/sagarrao","followers_url":"https://api.github.com/users/sagarrao/followers","following_url":"https://api.github.com/users/sagarrao/following{/other_user}","gists_url":"https://api.github.com/users/sagarrao/gists{/gist_id}","starred_url":"https://api.github.com/users/sagarrao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagarrao/subscriptions","organizations_url":"https://api.github.com/users/sagarrao/orgs","repos_url":"https://api.github.com/users/sagarrao/repos","events_url":"https://api.github.com/users/sagarrao/events{/privacy}","received_events_url":"https://api.github.com/users/sagarrao/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T15:35:13Z","updated_at":"2015-04-14T15:35:13Z","body":"Ok, so I enabled hystrix dashboard on my spring boot app.. \r\n\r\nThis what shows up on the browser when I hit the configured url for hystrx-dtream:\r\n\r\ndata: {\"type\":\"HystrixCommand\",\"name\":\"UserFetchCommand\",\"group\":\"CricketFetchUserCommandGroup\",\"currentTime\":1429025162203,\"isCircuitBreakerOpen\":false,\"errorPercentage\":0,\"errorCount\":0,\"requestCount\":0,\"rollingCountCollapsedRequests\":0,\"rollingCountExceptionsThrown\":0,\"rollingCountFailure\":0,\"rollingCountFallbackFailure\":0,\"rollingCountFallbackRejection\":0,\"rollingCountFallbackSuccess\":0,\"rollingCountResponsesFromCache\":0,\"rollingCountSemaphoreRejected\":0,\"rollingCountShortCircuited\":0,\"rollingCountSuccess\":0,\"rollingCountThreadPoolRejected\":0,\"rollingCountTimeout\":0,\"currentConcurrentExecutionCount\":1,\"latencyExecute_mean\":0,\"latencyExecute\":{\"0\":0,\"25\":0,\"50\":0,\"75\":0,\"90\":0,\"95\":0,\"99\":0,\"99.5\":0,\"100\":0},\"latencyTotal_mean\":0,\"latencyTotal\":{\"0\":0,\"25\":0,\"50\":0,\"75\":0,\"90\":0,\"95\":0,\"99\":0,\"99.5\":0,\"100\":0},\"propertyValue_circuitBreakerRequestVolumeThreshold\":20,\"propertyValue_circuitBreakerSleepWindowInMilliseconds\":5000,\"propertyValue_circuitBreakerErrorThresholdPercentage\":50,\"propertyValue_circuitBreakerForceOpen\":false,\"propertyValue_circuitBreakerForceClosed\":false,\"propertyValue_circuitBreakerEnabled\":true,\"propertyValue_executionIsolationStrategy\":\"SEMAPHORE\",\"propertyValue_executionIsolationThreadTimeoutInMilliseconds\":1000,\"propertyValue_executionIsolationThreadInterruptOnTimeout\":true,\"propertyValue_executionIsolationThreadPoolKeyOverride\":null,\"propertyValue_executionIsolationSemaphoreMaxConcurrentRequests\":10,\"propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests\":10,\"propertyValue_metricsRollingStatisticalWindowInMilliseconds\":10000,\"propertyValue_requestCacheEnabled\":true,\"propertyValue_requestLogEnabled\":true,\"reportingHosts\":1}\r\n\r\ndata: {\"type\":\"HystrixThreadPool\",\"name\":\"CricketFetchUserCommandGroup\",\"currentTime\":1429025162218,\"currentActiveCount\":0,\"currentCompletedTaskCount\":0,\"currentCorePoolSize\":10,\"currentLargestPoolSize\":0,\"currentMaximumPoolSize\":10,\"currentPoolSize\":0,\"currentQueueSize\":0,\"currentTaskCount\":0,\"rollingCountThreadsExecuted\":0,\"rollingMaxActiveThreads\":0,\"propertyValue_queueSizeRejectionThreshold\":5,\"propertyValue_metricsRollingStatisticalWindowInMilliseconds\":10000,\"reportingHosts\":1}\r\n\r\nIt's these 2 values which have been repeated right through. Our app is basically a spring-boot app, which has been scheduled to run at regular intervals and do all the necessary logic as pointed in the original post.."}}