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

TriggerMail / lazylru / 173
86%
master: 98%

Build:
Build:
LAST BUILD BRANCH: (HEAD detached at 69bb3b2)
DEFAULT BRANCH: master
Ran 18 Jun 2024 09:49PM UTC
Jobs 3
Files 21
Run time 1min
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

18 Jun 2024 09:48PM UTC coverage: 85.505% (+0.1%) from 85.399%
173

push

buildkite

web-flow
Fixing data race (#29)

When reading and writing the same key simultaneously, there were two races that could occur while escalating the lock from a reader lock to a writer lock in the `get` method.

* The expiration check in `get` was reading `pqi.expiration`
* The returned value in `get` was reading `pqi.value`

Both of happened after the call to `lru.lock.RUnlock()`, which means that set could have modified the item that `pqi` was pointing to. We are now copying the underlying item (`*pqi`) to the stack and referencing that. This is a pessimistic way to approach this problem, but it is safe.

A test was added that highlighted these races when run with `-race`.

Thanks @coxley for pointing these out and giving me a test that showed the problem.

11 of 11 new or added lines in 1 file covered. (100.0%)

1404 of 1642 relevant lines covered (85.51%)

1829345.46 hits per line

Jobs
ID Job ID Ran Files Coverage
173 generic - 173 18 Jun 2024 09:49PM UTC 0
97.94
173 interface - 173 18 Jun 2024 09:49PM UTC 0
97.22
173 bench - 173 18 Jun 2024 09:51PM UTC 0
37.0
Source Files on build 173
Detailed source file information is not available for this build.
  • Back to Repo
  • 062025bc on github
  • Prev Build on (HEAD detached at 463a294) (#169)
  • Next Build on (HEAD detached at 062025b) (#174)
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

© 2026 Coveralls, Inc