We are using elastic java rest high client 6.1, but often and randomly the rest client return an timeout.
We alredy customize timeout in this way:
client.setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback {
override def customizeRequestConfig(requestConfigBuilder: RequestConfig.Builder): RequestConfig.Builder = {
requestConfigBuilder
.setConnectionRequestTimeout(0)
.setConnectTimeout(parameters.getInt(s"$propertyGroup.timeout.connection"))
.setSocketTimeout(parameters.getInt(s"$propertyGroup.timeout.socket"))
}
}).setMaxRetryTimeoutMillis(parameters.getInt(s"$propertyGroup.timeout.socket"))
.setFailureListener(new RestClient.FailureListener {
override def onFailure(host: HttpHost): Unit = {
val a = 0
}
})
And during our test we set timeout threshold in 60000ms, 100000ms, 180000ms; and still randomly get a timeout exception.
This issue happens only when we run a FLINK JOB that run as much fast it can many queries in parallel, or when we query elastic into a ForEach with billions of iterations.
There is a strategy, idea, snippet of code, configuration, best practise, etc. to: Wait few seconds (or milliseconds) and try again to execute the failed query?
For who have same issue...
By my test seems that a timeout can be avoided just adding more ram.
Of course it depend by the reason of timeout; while I was figuring out to my issue I discovered three potential reasons:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With