You are looking at documentation for an older release.
Not what you want? See the
current release documentation.
Fail overedit
When using connection pooling and the pool has sufficient nodes a request will be retried if the call to a node throws an exception or returns a 502, 503 or 504
var audit = new Auditor(() => Framework.Cluster
.Nodes(10)
.ClientCalls(r => r.FailAlways())
.ClientCalls(r => r.OnPort(9201).SucceedAlways())
.StaticConnectionPool()
.Settings(s => s.DisablePing())
);
audit = await audit.TraceCall(
new ClientCall {
{ BadResponse, 9200 },
{ HealthyResponse, 9201 },
}
);502 Bad Gatewayedit
Will be treated as an error that requires retrying
var audit = new Auditor(() => Framework.Cluster
.Nodes(10)
.ClientCalls(r => r.FailAlways(502))
.ClientCalls(r => r.OnPort(9201).SucceedAlways())
.StaticConnectionPool()
.Settings(s => s.DisablePing())
);
audit = await audit.TraceCall(
new ClientCall {
{ BadResponse, 9200 },
{ HealthyResponse, 9201 },
}
);503 Service Unavailableedit
Will be treated as an error that requires retrying
var audit = new Auditor(() => Framework.Cluster
.Nodes(10)
.ClientCalls(r => r.FailAlways(503))
.ClientCalls(r => r.OnPort(9201).SucceedAlways())
.StaticConnectionPool()
.Settings(s => s.DisablePing())
);
audit = await audit.TraceCall(
new ClientCall {
{ BadResponse, 9200 },
{ HealthyResponse, 9201 },
}
);504 Gateway Timeoutedit
Will be treated as an error that requires retrying
var audit = new Auditor(() => Framework.Cluster
.Nodes(10)
.ClientCalls(r => r.FailAlways(504))
.ClientCalls(r => r.OnPort(9201).SucceedAlways())
.StaticConnectionPool()
.Settings(s => s.DisablePing())
);
audit = await audit.TraceCall(
new ClientCall {
{ BadResponse, 9200 },
{ HealthyResponse, 9201 },
}
);If a call returns a valid http status code other than 502, 503 or 504, the request won’t be retried.
Different requests may have different status codes that are deemed valid. For example, a 404 Not Found response is a valid status code for an index exists request
var audit = new Auditor(() => Framework.Cluster
.Nodes(10)
.ClientCalls(r => r.FailAlways(418))
.ClientCalls(r => r.OnPort(9201).SucceedAlways())
.StaticConnectionPool()
.Settings(s => s.DisablePing())
);
audit = await audit.TraceCall(
new ClientCall {
{ BadResponse, 9200 },
}
);