mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
refactor(shared-state): drop the unused local arm of sharedBreaker
Every caller keeps its own local breaker and reads only sharedOpen, so the local arm in sharedBreaker (isOpen, recordFailureLocal, breakerLocal) was reached only by tests. A per-id failure count since the last success replaces it, because recordSuccess still needs it to decide whether a fleet reset write is due. Tests now read sharedOpen. A failover test pins that the caller's local breaker still opens while the store is down.
This commit is contained in:
@@ -37,15 +37,15 @@ const ssProbeSource = `func sharedStateProbe() string {
|
||||
}
|
||||
la.refresh()
|
||||
lb.refresh()
|
||||
if !b.isOpen("p") {
|
||||
if !b.sharedOpen("p") {
|
||||
return "breaker: second instance closed after the first tripped it and one refresh"
|
||||
}
|
||||
if b.isOpen("other") {
|
||||
if b.sharedOpen("other") {
|
||||
return "breaker: a trip on one id opened another"
|
||||
}
|
||||
b.recordSuccess("p")
|
||||
lb.refresh()
|
||||
if b.isOpen("p") {
|
||||
if b.sharedOpen("p") {
|
||||
return "breaker: second instance still open after its own success"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user