Skip to content

Commit 37f29bf

Browse files
authored
migrillian: Return error if context was canceled (google#852)
This prevents Migrillian from skipping a range in case one Trillian submission fails. The explicitly returned error will cause a controller restart.
1 parent a030368 commit 37f29bf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

trillian/migrillian/core/controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ func (c *Controller) fetchTail(ctx context.Context, begin uint64) (uint64, error
326326
if err != nil {
327327
return 0, err
328328
}
329+
// Run may have returned nil despite a cancel() call.
330+
if err := cctx.Err(); err != nil {
331+
return 0, fmt.Errorf("failed to fetch and submit the entire tail: %v", err)
332+
}
329333
return sth.TreeSize, nil
330334
}
331335

0 commit comments

Comments
 (0)