• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

letsencrypt / boulder / 11016 / 7
66%
master: 66%

Build:
DEFAULT BRANCH: master
Ran 31 Jul 2019 08:01PM UTC
Files 103
Run time 33s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Jul 2019 07:41PM UTC coverage: 61.633% (+0.02%) from 61.61%
RUN="coverage" CONTAINER="netaccess"

push

travis-ci

rolandshoemaker
sa: wrap transactions in a function for commits/rollbacks (#4373)

In the current SA code, we need to remember to call Rollback on any error.
If we don't, we'll leave dangling transactions, which are hard to spot but eventually
clog up the database and cause availability problems.

This change attempts to deal with rollbacks more rigorously, by implementing a
withTransaction function that takes a closure as input. withTransaction opens
a transaction, applies a context.Context to it, and then runs the closure. If the
closure returns an error, withTransaction rolls back and return the error; otherwise
it commits and returns nil.

One of the quirks of this implementation is that it relies on the closure modifying
variables from its parent scope in order to return values. An alternate implementation
could define the return value of the closure as interface{}, nil, and have the calling
function do a type assertion. I'm seeking feedback on that; not sure yet which is cleaner.

This is a subset of the functions that need this treatment. I've got more coming, but
some of the changes break tests so I'm checking into why.

Updates #4337

11531 of 18709 relevant lines covered (61.63%)

0.69 hits per line

Source Files on job 11016.7 (RUN="coverage" CONTAINER="netaccess")
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 10415
  • Travis Job 11016.7
  • 16235b68 on github
  • Prev Job for RUN="coverage" CONTAINER="netaccess" on master (#11014.7)
  • Next Job for RUN="coverage" CONTAINER="netaccess" on master (#11021.7)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc