Skip to content

Commit

Permalink
Don't complete bury pushback errs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Aug 1, 2024
1 parent 64b4844 commit 754034b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 11 additions & 0 deletions hammer/hammer.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,22 @@ func (h *Hammer) Run(ctx context.Context) {

// Set up logging for any errors
go func() {
tick := time.NewTicker(time.Second)
pbCount := 0
for {
select {
case <-ctx.Done(): //context cancelled
return
case <-tick.C:
if pbCount > 0 {
klog.Warningf("%d requests received pushback from log")

Check failure on line 167 in hammer/hammer.go

View workflow job for this annotation

GitHub Actions / test (1.22.x, ubuntu-latest)

k8s.io/klog/v2.Warningf format %d reads arg #1, but call has 0 args

Check failure on line 167 in hammer/hammer.go

View workflow job for this annotation

GitHub Actions / lint

printf: k8s.io/klog/v2.Warningf format %d reads arg #1, but call has 0 args (govet)
pbCount = 0
}
case err := <-h.errChan:
if errors.Is(err, ErrRetry) {
pbCount++
continue
}
klog.Warning(err)
}
}
Expand Down
4 changes: 1 addition & 3 deletions hammer/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@ func (w *LogWriter) Run(ctx context.Context) {
lt := leafTime{queuedAt: time.Now()}
index, err := w.writer(ctx, newLeaf)
if err != nil {
if !errors.Is(ErrRetry, err) {
w.errChan <- fmt.Errorf("failed to create request: %w", err)
}
w.errChan <- fmt.Errorf("failed to create request: %w", err)
continue
}
lt.idx, lt.assignedAt = index, time.Now()
Expand Down

0 comments on commit 754034b

Please sign in to comment.