Skip to content

Commit

Permalink
[kafka] Remove context.DeadlineExceeded from retryable errors (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie authored Apr 4, 2024
1 parent 9a51b75 commit a674c6d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
14 changes: 1 addition & 13 deletions lib/kafkalib/errors.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package kafkalib

import (
"context"
"errors"
"log/slog"
"strings"
Expand Down Expand Up @@ -35,16 +34,5 @@ func isRetryableError(err error) bool {
return false
}

retryableErrs := []error{
context.DeadlineExceeded,
kafka.TopicAuthorizationFailed,
}

for _, retryableErr := range retryableErrs {
if errors.Is(err, retryableErr) {
return true
}
}

return false
return errors.Is(err, kafka.TopicAuthorizationFailed)
}
5 changes: 0 additions & 5 deletions lib/kafkalib/errors_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package kafkalib

import (
"context"
"fmt"
"testing"

Expand Down Expand Up @@ -62,10 +61,6 @@ func TestIsRetryableError(t *testing.T) {
err: kafka.TopicAuthorizationFailed,
expected: true,
},
{
err: context.DeadlineExceeded,
expected: true,
},
{
err: kafka.MessageSizeTooLarge,
expected: false,
Expand Down

0 comments on commit a674c6d

Please sign in to comment.