{"action":"created","issue":{"url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1261","repository_url":"https://api.github.com/repos/sksamuel/elastic4s","labels_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1261/labels{/name}","comments_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1261/comments","events_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1261/events","html_url":"https://github.com/sksamuel/elastic4s/issues/1261","id":291276890,"node_id":"MDU6SXNzdWUyOTEyNzY4OTA=","number":1261,"title":"java.util.concurrent.TimeoutException sometimes arise","user":{"login":"dacr","id":381901,"node_id":"MDQ6VXNlcjM4MTkwMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/381901?v=4","gravatar_id":"","url":"https://api.github.com/users/dacr","html_url":"https://github.com/dacr","followers_url":"https://api.github.com/users/dacr/followers","following_url":"https://api.github.com/users/dacr/following{/other_user}","gists_url":"https://api.github.com/users/dacr/gists{/gist_id}","starred_url":"https://api.github.com/users/dacr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dacr/subscriptions","organizations_url":"https://api.github.com/users/dacr/orgs","repos_url":"https://api.github.com/users/dacr/repos","events_url":"https://api.github.com/users/dacr/events{/privacy}","received_events_url":"https://api.github.com/users/dacr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-01-24T16:38:51Z","updated_at":"2018-10-30T11:17:41Z","closed_at":null,"author_association":"NONE","body":"using elastic4s 6.1.3 with elasticsearch 6.1.2, I got sometimes concurrent.TimeoutException while doing a huge bulk inserts operation : \r\n\r\n```\r\n[info] ElasticExperimentsFetchTest:\r\n[info] - insert and fetch *** FAILED ***\r\n[info]   com.sksamuel.elastic4s.http.JavaClientExceptionWrapper: java.util.concurrent.TimeoutException\r\n[info]   at com.sksamuel.elastic4s.http.ElasticsearchJavaRestClient$$anon$1.onFailure(ElasticsearchJavaRestClient.scala:40)\r\n[info]   at org.elasticsearch.client.RestClient$FailureTrackingResponseListener.onDefinitiveFailure(RestClient.java:608)\r\n[info]   at org.elasticsearch.client.RestClient$1.retryIfPossible(RestClient.java:399)\r\n[info]   at org.elasticsearch.client.RestClient$1.failed(RestClient.java:378)\r\n[info]   at org.apache.http.concurrent.BasicFuture.failed(BasicFuture.java:134)\r\n[info]   at org.apache.http.impl.nio.client.AbstractClientExchangeHandler.failed(AbstractClientExchangeHandler.java:419)\r\n[info]   at org.apache.http.impl.nio.client.AbstractClientExchangeHandler.connectionRequestFailed(AbstractClientExchangeHandler.java:335)\r\n[info]   at org.apache.http.impl.nio.client.AbstractClientExchangeHandler.access$100(AbstractClientExchangeHandler.java:62)\r\n[info]   at org.apache.http.impl.nio.client.AbstractClientExchangeHandler$1.failed(AbstractClientExchangeHandler.java:378)\r\n[info]   at org.apache.http.concurrent.BasicFuture.failed(BasicFuture.java:134)\r\n[info]   ...\r\n[info]   Cause: java.util.concurrent.TimeoutException:\r\n[info]   at org.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequest(AbstractNIOConnPool.java:364)\r\n[info]   at org.apache.http.nio.pool.AbstractNIOConnPool.processNextPendingRequest(AbstractNIOConnPool.java:344)\r\n[info]   at org.apache.http.nio.pool.AbstractNIOConnPool.release(AbstractNIOConnPool.java:318)\r\n[info]   at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.releaseConnection(PoolingNHttpClientConnectionManager.java:303)\r\n[info]   at org.apache.http.impl.nio.client.AbstractClientExchangeHandler.releaseConnection(AbstractClientExchangeHandler.java:239)\r\n[info]   at org.apache.http.impl.nio.client.MainClientExec.responseCompleted(MainClientExec.java:387)\r\n[info]   at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:168)\r\n[info]   at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:436)\r\n[info]   at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:326)\r\n[info]   at org.apache.http.impl.nio.client.InternalRequestExecutor.inputReady(InternalRequestExecutor.java:83)\r\n[info]   ...\r\n```\r\n\r\nThe big insertions is done this way (`for` comprehension on futures) : \r\n```\r\n    val insertResults = for {\r\n      cleaned <- doClean // delete any existing index\r\n      created <- doCreateTestIndex // create the index\r\n      refreshDisabled <- doUpdateIndexRefreshInterval(\"-1\") // To accelerate insertion\r\n      responses <- insertEvents // bulk operation insert all events\r\n      refreshEnabled <- doUpdateIndexRefreshInterval(\"10s\") // revert back to a normal behavior\r\n      refreshed <- doRefreshIndex // to wait for every to be available for search...\r\n    } yield {\r\n      responses\r\n    }\r\n```\r\neach bulk is composed of ~1000 events, and I'm trying to insert 500000 events and unfortunately I got some time that concurrent TimeoutException, and almost systematically after a fresh elasticsearch restart.\r\n"},"comment":{"url":"https://api.github.com/repos/sksamuel/elastic4s/issues/comments/434262008","html_url":"https://github.com/sksamuel/elastic4s/issues/1261#issuecomment-434262008","issue_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/1261","id":434262008,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDI2MjAwOA==","user":{"login":"abdvel","id":12128119,"node_id":"MDQ6VXNlcjEyMTI4MTE5","avatar_url":"https://avatars3.githubusercontent.com/u/12128119?v=4","gravatar_id":"","url":"https://api.github.com/users/abdvel","html_url":"https://github.com/abdvel","followers_url":"https://api.github.com/users/abdvel/followers","following_url":"https://api.github.com/users/abdvel/following{/other_user}","gists_url":"https://api.github.com/users/abdvel/gists{/gist_id}","starred_url":"https://api.github.com/users/abdvel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abdvel/subscriptions","organizations_url":"https://api.github.com/users/abdvel/orgs","repos_url":"https://api.github.com/users/abdvel/repos","events_url":"https://api.github.com/users/abdvel/events{/privacy}","received_events_url":"https://api.github.com/users/abdvel/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T11:17:41Z","updated_at":"2018-10-30T11:17:41Z","author_association":"NONE","body":"hi,\r\nI have the same issue.\r\nHow to add setConnectionRequestTimeout in Aws4ElasticClient?\r\n\r\nThis is my configuration\r\n```\r\nval esConfig = Aws4ElasticConfig(elasticEndpoint, awsAccessKey, awsSecretKey, awsRegion)\r\nval esClient = Aws4ElasticClient(esConfig)\r\n```\r\nI got always concurrent.TimeoutException when multiple request\r\n\r\nThank you for help."}}
{"actor":{"display_login":"abdvel"}}