Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit b820e88

Browse files
maxmoehlgeofffranks
authored andcommitted
fix: prevent side-effects of additional retry-able errors
This commit removes `IdempotentRequestEOF` and `IncompleteRequest` from the fail-able and prune-able classifier group. This prevents errors that should not affect the endpoint from being marked as failed or being pruned. To do so all classifiers groups are split into distinct groups and any cross references between them are removed. The main motivation for this change is to avoid confusion and bugs due to artificial dependencies between the groups. Partially-Resolves: cloudfoundry/routing-release#321 Tested-By: `routing-release/scripts/run-unit-tests-in-docker gorouter`
1 parent 7c163e5 commit b820e88

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

proxy/fails/classifier_group.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,27 @@ var RetriableClassifiers = ClassifierGroup{
2424
}
2525

2626
var FailableClassifiers = ClassifierGroup{
27-
RetriableClassifiers,
27+
Dial,
28+
AttemptedTLSWithNonTLSBackend,
29+
HostnameMismatch,
30+
RemoteFailedCertCheck,
31+
RemoteHandshakeFailure,
32+
RemoteHandshakeTimeout,
33+
UntrustedCert,
34+
ExpiredOrNotYetValidCertFailure,
2835
ConnectionResetOnRead,
2936
}
3037

31-
var PrunableClassifiers = RetriableClassifiers
38+
var PrunableClassifiers = ClassifierGroup{
39+
Dial,
40+
AttemptedTLSWithNonTLSBackend,
41+
HostnameMismatch,
42+
RemoteFailedCertCheck,
43+
RemoteHandshakeFailure,
44+
RemoteHandshakeTimeout,
45+
UntrustedCert,
46+
ExpiredOrNotYetValidCertFailure,
47+
}
3248

3349
// Classify returns true on errors that are retryable
3450
func (cg ClassifierGroup) Classify(err error) bool {

proxy/fails/classifier_group_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var _ = Describe("ClassifierGroup", func() {
5656
})
5757

5858
Describe("prunable", func() {
59-
It("matches hostname mismatch", func() {
59+
It("matches prunable errors", func() {
6060
pc := fails.PrunableClassifiers
6161

6262
Expect(pc.Classify(&net.OpError{Op: "dial"})).To(BeTrue())
@@ -69,8 +69,6 @@ var _ = Describe("ClassifierGroup", func() {
6969
Expect(pc.Classify(x509.UnknownAuthorityError{})).To(BeTrue())
7070
Expect(pc.Classify(x509.CertificateInvalidError{Reason: x509.Expired})).To(BeTrue())
7171
Expect(pc.Classify(errors.New("i'm a potato"))).To(BeFalse())
72-
Expect(pc.Classify(fails.IdempotentRequestEOFError)).To(BeTrue())
73-
Expect(pc.Classify(fails.IncompleteRequestError)).To(BeTrue())
7472
})
7573
})
7674
})

0 commit comments

Comments
 (0)