Skip to content

Commit 8f91968

Browse files
committed
[Hammer] Make failed leaves be stickier
1 parent fe7687c commit 8f91968

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/hammer/loadtest/workers.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import (
2727
"github.com/transparency-dev/formats/log"
2828
"github.com/transparency-dev/merkle/proof"
2929
hasher "github.com/transparency-dev/merkle/rfc6962"
30+
"github.com/transparency-dev/tessera/api/layout"
3031
"github.com/transparency-dev/tesseract/internal/client"
3132
"github.com/transparency-dev/tesseract/internal/types/rfc6962"
3233
"github.com/transparency-dev/tesseract/internal/x509util"
33-
"github.com/transparency-dev/tessera/api/layout"
3434
"k8s.io/klog/v2"
3535
)
3636

@@ -220,13 +220,14 @@ func (w *LogWriter) Run(ctx context.Context) {
220220
panic("LogWriter was run multiple times")
221221
}
222222
ctx, w.cancel = context.WithCancel(ctx)
223+
newLeaf := w.gen()
223224
for {
224225
select {
225226
case <-ctx.Done():
226227
return
227228
case <-w.throttle:
228229
}
229-
newLeaf := w.gen()
230+
230231
lt := LeafTime{QueuedAt: time.Now()}
231232
index, timestamp, err := w.writer(ctx, newLeaf)
232233
if err != nil {
@@ -264,6 +265,7 @@ func (w *LogWriter) Run(ctx context.Context) {
264265
}
265266

266267
klog.V(2).Infof("Wrote leaf at index %d", index)
268+
newLeaf = w.gen()
267269
}
268270
}
269271

0 commit comments

Comments
 (0)