Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
rokatyy committed Jan 27, 2025
1 parent 7efff50 commit aff13f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
7 changes: 0 additions & 7 deletions pkg/common/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,6 @@ func EngineErrorIsNonFatal(err error) bool {
return errorMatches(err, nonFatalEngineErrorsPartialMatch)
}

func EngineErrorNeedsIndefiniteRetry(err error) bool {
var fatalEngineErrorsPartialMatch = []string{
"lookup v3io-webapi: i/o timeout",
}
return errorMatches(err, fatalEngineErrorsPartialMatch)
}

func errorMatches(err error, substrings []string) bool {
if err != nil && len(err.Error()) > 0 {
for _, substring := range substrings {
Expand Down
13 changes: 3 additions & 10 deletions pkg/dataplane/streamconsumergroup/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,13 @@ func (c *claim) fetchRecordBatches(stopChannel chan struct{}, fetchInterval time
func(attempt int) (bool, error, int) {
c.currentShardLocation, err = c.getCurrentShardLocation(c.shardID)
if err != nil {
// if the error is fatal and requires external resolution,
// if the error is not fatal (as network issue),
// we don't want to fail; instead, we will inform the user via a log
if common.EngineErrorNeedsIndefiniteRetry(err) {
c.logger.ErrorWith("Failed to get shard location. Will retry until successful",
"error", err,
"shard", c.shardID)
if common.EngineErrorIsNonFatal(err) {
// for this type of error, we always increment the attempt counter
// this ensures the smooth operation of other components in Nuclio
// we avoid panicking and simply wait for the issue to be resolved
return true, errors.Wrap(err, "Failed to get shard location"), 1
}

if common.EngineErrorIsNonFatal(err) {
return true, errors.Wrap(err, "Failed to get shard location due to a network error"), 0
return true, errors.Wrap(err, "Failed to get shard location due to a network error"), 1
}

// requested for an immediate stop
Expand Down

0 comments on commit aff13f6

Please sign in to comment.