Skip to content

Commit 91947dc

Browse files
authored
sa: use tx object in AddPrecertificate (#8865)
Most of the body of this WithTransaction call used `tx` for manipulating the database, but the call to insert the certificateStatus row accidentally used sa.dbMap, meaning that call did not participate in transactional guarantees. Wrote a similar bug while working on #8826, asked Claude to find the same pattern elsewhere in the codebase and came up with this one.
1 parent cf71498 commit 91947dc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sa/sa.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ func (ssa *SQLStorageAuthority) AddPrecertificate(ctx context.Context, req *sapb
264264
IsExpired: false,
265265
IssuerID: req.IssuerNameID,
266266
}
267-
err = ssa.dbMap.Insert(ctx, cs)
267+
err = tx.Insert(ctx, cs)
268268
if err != nil {
269269
return nil, err
270270
}
@@ -1601,7 +1601,7 @@ func (ssa *SQLStorageAuthority) updateRateLimitOverride(
16011601
UPDATE overrides
16021602
SET comment = :comment,
16031603
periodNS = :periodNS,
1604-
count = :count,
1604+
count = :count,
16051605
burst = :burst,
16061606
updatedAt = :updatedAt,
16071607
enabled = :enabled

0 commit comments

Comments
 (0)