mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-25 09:25:56 +03:00
[GH-ISSUE #533] A more resilient circuit breaker strategy #183
Labels
No labels
bug
confirmed
discussion
duplicate
enhancement
feature
feature-request
not-planned
pull-request
secondary-feature
stale
triage
waiting-feedback
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/dns-proxy-server-mageddo#183
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mageddo on GitHub (Aug 1, 2024).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/533
Summary & Motivation
Currently the circuit breaker strategy is set as below:
It's a very unflexible config, remote servers that are totally offline will be reactivated every 20 seconds and stable
servers which got 3 timeouts will be removed from the pool for 20 seconds, which is not ideal because it will make some
requests slower than they could be and not solve some requests for some time because of a temporary and isolated
denial of service of one remote server.
Description
the user, strategy will be named
CANARY_RATE_THRESHOLDSTATIC_THRESHOLDSTATIC_THRESHOLDwill be configured by defaultSTATIC_THRESHOLDeven if no type was defined, making DPS compatible with previous versions.
Estratégia 2
Unit Test use cases
Circuito Fechado - Servidor cai
No circuit breaker, depois de 50 chamadas feitas, se 10 execuções tiverem 20% de erro ou mais, abre o circuito
Circuito Aberto - Servidor Volta
Worker que roda a cada 1 segundo checa o circuito de 1 até 3 chamadas, se uma delas retornar OK, muda o estado
para meio aberto.
Circuito Meio Aberto - Servidor Saudável
No circuit breaker, 10 execuções com menos de 20% de erro, o circuito muda o estado para fechado
Circuito Meio Aberto - Servidor Não Saudável
No circuit breaker, 10 execuções com mais de 20% de erro, o circuito mudar o estado para aberto
Tasks
STATIC_THRESHOLDusecase, then I will need to abstract circuit breaker solution to be able to use the two libs at the same timeAlternatives
Estratégia 1
tentativas num período de 20 segundos
se 70% das requisições derem sucesso ele fecha novamente
Risks and Assumptions