Skip to content

Anti-flapping

A threshold that moves with latency can hover around the failure rate and flip the circuit repeatedly. fluxgo prevents this with a minimum dwell time.

After any state transition, the circuit cannot trip from Closed to Open again until MinDwellTime has elapsed (5 s by default).

cfg := fluxgo.DefaultConfig()
cfg.MinDwellTime = 10 * time.Second

Setting it to 0 disables the guard. Detection becomes as fast as the signals allow, at the cost of possible oscillation when the failure rate hovers around θₜ.

FieldRole
RecoveryTimeoutHow long the circuit stays Open before probing (Half-Open)
HalfOpenMaxRequestsHow many probe requests are admitted while Half-Open
MinRequestsOutcomes needed in the window before a failure rate is evaluated