[7.x] Deprecate returning 408 for a server timeout on _cluster/health (#78180) (#78940)

Backports #78180 to 7.x.

Add a deprecation warning and a system property es.cluster_health.request_timeout_200 to opt in for returning 200 which will be the default in 8.0.0

Fixes #70849
This commit is contained in:
Artem Prigoda 2021-10-11 22:13:26 +02:00 committed by GitHub
parent 5d9001c7c7
commit 03bd55d197
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 3 deletions

View file

@ -304,6 +304,9 @@ public class ClusterClientIT extends ESRestHighLevelClientTestCase {
assertThat(response.status(), equalTo(RestStatus.REQUEST_TIMEOUT));
assertThat(response.getStatus(), equalTo(ClusterHealthStatus.RED));
assertNoIndices(response);
assertWarnings("The HTTP status code for a cluster health timeout will be changed from 408 to 200 in a " +
"future version. Set the [es.cluster_health.request_timeout_200] system property to [true] to suppress this message and " +
"opt in to the future behaviour now.");
}
public void testRemoteInfo() throws Exception {