Show a target paused by its circuit breaker (closes #385)
check / check (push) Waiting to run
check / check (push) Waiting to run
A target whose circuit breaker had tripped still showed as Active, and its deliveries sat at a bare "retrying" with no attempts. Its row on the webhook page now says deliveries are paused after repeated failures and until when the cooldown ends, adding that one waiting delivery is then sent to test the target; while half-open it says deliveries are held while one tests it, with no time. Waiting deliveries show "next try no earlier than" the later of the cooldown and their own backoff, with the date when not today. The engine gains one read of a breaker's state and remaining cooldown under one lock, and shares the backoff formula. Model: opus-5-5
This commit was merged in pull request #478.
This commit is contained in:
@@ -62,6 +62,17 @@ func (e *noopArchives) Rename(_, _, _ string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// noopCircuitBreakers satisfies handlers.New's
|
||||
// delivery.CircuitBreakers dependency with no target's deliveries
|
||||
// paused.
|
||||
type noopCircuitBreakers struct{}
|
||||
|
||||
func (b *noopCircuitBreakers) StateAndCooldown(
|
||||
string,
|
||||
) (delivery.CircuitState, time.Duration) {
|
||||
return delivery.CircuitClosed, 0
|
||||
}
|
||||
|
||||
// testEnv is the real router from routes.go plus the collaborators
|
||||
// tests need to seed users and forge sessions.
|
||||
type testEnv struct {
|
||||
@@ -126,6 +137,9 @@ func newTestEnvWithConfig(
|
||||
session.New,
|
||||
func() delivery.Notifier { return &noopNotifier{} },
|
||||
func() delivery.Archives { return &noopArchives{} },
|
||||
func() delivery.CircuitBreakers {
|
||||
return &noopCircuitBreakers{}
|
||||
},
|
||||
metrics.NewRegistry,
|
||||
metrics.New,
|
||||
middleware.New,
|
||||
|
||||
Reference in New Issue
Block a user