Skip to content

Commit

Permalink
fix: reset translate in retry (#2756)
Browse files Browse the repository at this point in the history
* fix reset transalte in retry

Signed-off-by: Guy Daich <[email protected]>

* fx reset transalte in retry

Signed-off-by: Guy Daich <[email protected]>

---------

Signed-off-by: Guy Daich <[email protected]>
  • Loading branch information
guydc authored Mar 4, 2024
1 parent 4db02e6 commit 75fcedc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/retry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type RetryOn struct {
}

// TriggerEnum specifies the conditions that trigger retries.
// +kubebuilder:validation:Enum={"5xx","gateway-error","disconnect-reset","connect-failure","retriable-4xx","refused-stream","retriable-status-codes","cancelled","deadline-exceeded","internal","resource-exhausted","unavailable"}
// +kubebuilder:validation:Enum={"5xx","gateway-error","reset","connect-failure","retriable-4xx","refused-stream","retriable-status-codes","cancelled","deadline-exceeded","internal","resource-exhausted","unavailable"}
type TriggerEnum string

const (
Expand All @@ -57,7 +57,7 @@ const (
// The response is a gateway error (502,503 or 504).
GatewayError TriggerEnum = "gateway-error"
// The upstream server does not respond at all (disconnect/reset/read timeout.)
DisconnectRest TriggerEnum = "disconnect-reset"
Reset TriggerEnum = "reset"
// Connection failure to the upstream server (connect timeout, etc.). (Included in *5xx*)
ConnectFailure TriggerEnum = "connect-failure"
// The upstream server responds with a retriable 4xx response code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ spec:
enum:
- 5xx
- gateway-error
- disconnect-reset
- reset
- connect-failure
- retriable-4xx
- refused-stream
Expand Down
2 changes: 1 addition & 1 deletion internal/ir/xds.go
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ type TriggerEnum egv1a1.TriggerEnum
const (
Error5XX = TriggerEnum(egv1a1.Error5XX)
GatewayError = TriggerEnum(egv1a1.GatewayError)
DisconnectRest = TriggerEnum(egv1a1.DisconnectRest)
Reset = TriggerEnum(egv1a1.Reset)
ConnectFailure = TriggerEnum(egv1a1.ConnectFailure)
Retriable4XX = TriggerEnum(egv1a1.Retriable4XX)
RefusedStream = TriggerEnum(egv1a1.RefusedStream)
Expand Down
2 changes: 1 addition & 1 deletion internal/xds/translator/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ func buildRetryOn(triggers []ir.TriggerEnum) (string, error) {
lookup := map[ir.TriggerEnum]string{
ir.Error5XX: "5xx",
ir.GatewayError: "gateway-error",
ir.DisconnectRest: "disconnect-reset",
ir.Reset: "reset",
ir.ConnectFailure: "connect-failure",
ir.Retriable4XX: "retriable-4xx",
ir.RefusedStream: "refused-stream",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ http:
- 429
- 503
triggers:
- reset
- connect-failure
- retriable-status-codes
perRetry:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- name: envoy.retry_host_predicates.previous_hosts
typedConfig:
'@type': type.googleapis.com/envoy.extensions.retry.host.previous_hosts.v3.PreviousHostsPredicate
retryOn: connect-failure,retriable-status-codes
retryOn: reset,connect-failure,retriable-status-codes
upgradeConfigs:
- upgradeType: websocket
- domains:
Expand Down

0 comments on commit 75fcedc

Please sign in to comment.