Skip to content

Commit 0d34f11

Browse files
committed
comments
1 parent 40bbc0e commit 0d34f11

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

pkg/common/helper.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ func getFunctionName(fn interface{}) string {
3535
return runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()
3636
}
3737

38-
// give either retryInterval or backoff
38+
// RetryFunc give either retryInterval or backoff
39+
// gets fn func(int) (bool, error, int) as parameter
40+
// which returns:
41+
// bool - whether should be retried
42+
// error - whether error happened
43+
// int - increments retries (allows manage retries count from inside of this function)
3944
func RetryFunc(ctx context.Context,
4045
loggerInstance logger.Logger,
4146
attempts int,
@@ -189,10 +194,11 @@ func EngineErrorIsNonFatal(err error) bool {
189194

190195
func EngineErrorIsFatal(err error) bool {
191196
var fatalEngineErrorsPartialMatch = []string{
192-
"Failed to fetch record batches",
197+
"lookup v3io-webapi: i/o timeout",
193198
}
194199
return errorMatches(err, fatalEngineErrorsPartialMatch)
195200
}
201+
196202
func errorMatches(err error, substrings []string) bool {
197203
if err != nil && len(err.Error()) > 0 {
198204
for _, substring := range substrings {

pkg/dataplane/streamconsumergroup/claim.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ func (c *claim) fetchRecordBatches(stopChannel chan struct{}, fetchInterval time
126126
c.logger,
127127
c.getShardLocationAttempts,
128128
nil,
129-
&c.getShardLocationBackoff, func(attempt int) (bool, error, int) {
129+
&c.getShardLocationBackoff,
130+
func(attempt int) (bool, error, int) {
130131
c.currentShardLocation, err = c.getCurrentShardLocation(c.shardID)
131132
if err != nil {
132133
if common.EngineErrorIsNonFatal(err) {

0 commit comments

Comments
 (0)