CoolCMS API

EsCircuitBreaker
in package

FinalYes

Outage circuit breaker for Elasticsearch, shared by the read and write paths.

The state lives in the Redis key es:{indexPrefix}:down with a 60 s ttl. While open, ES calls are skipped without waiting for timeouts; writes missed meanwhile are caught up by sync or full reindex. Without Redis the breaker does nothing and degradation relies only on the short request timeouts of the client.

Table of Contents

Constants

KEY_SUFFIX  : mixed = 'down'
TTL  : mixed = 60

Properties

$config  : EsConfig
$redis  : Client|null

Methods

__construct()  : mixed
isOpen()  : bool
open()  : void
openFor()  : void
Opens the breaker only for outage errors. A 4xx response (`ClientResponseException`, e.g. 404 for a missing index before bootstrap or a malformed query) is not a cluster outage and must not switch search off for everyone.

Constants

Properties

Methods

openFor()

Opens the breaker only for outage errors. A 4xx response (`ClientResponseException`, e.g. 404 for a missing index before bootstrap or a malformed query) is not a cluster outage and must not switch search off for everyone.

public openFor(Throwable $e) : void
Parameters
$e : Throwable
On this page

Search results