File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -173,18 +173,18 @@ func (r *Reader) commitOffsetsWithRetry(gen *Generation, offsetStash offsetStash
173173 }
174174 }
175175
176- if err = gen .CommitOffsetsForGenID (generationID , messages ); err == nil {
176+ if commitErr : = gen .CommitOffsetsForGenID (generationID , messages ); commitErr == nil {
177177 continue
178- }
179- // IllegalGeneration error is not retriable, but we should attempt to
180- // perform the remaining commits
181- if err == IllegalGeneration {
182- r .withErrorLogger (func (l Logger ) { l .Printf ("%v" , err ) })
183- illegalGenerationErr = err
184- // we prevent useless retries and we will attempt to
185- // commit the remaining generations.
186- err = nil
187- offsetStash . removeGenerationID ( generationID )
178+ } else {
179+ // IllegalGeneration error is not retriable, but we should attempt to
180+ // perform the remaining commits
181+ if commitErr == IllegalGeneration {
182+ r .withErrorLogger (func (l Logger ) { l .Printf ("%v" , commitErr ) })
183+ illegalGenerationErr = commitErr
184+ offsetStash . removeGenerationID ( generationID )
185+ } else {
186+ err = commitErr
187+ }
188188 }
189189 }
190190 }
You can’t perform that action at this time.
0 commit comments