Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Issue 2554793002: impl/memory: Fix memcache stats race. (Closed)

Created:
4 years ago by dnj
Modified:
4 years ago
Reviewers:
iannucci
CC:
chromium-reviews, infra-reviews+luci-gae_chromium.org
Target Ref:
refs/heads/master
Project:
luci-gae
Visibility:
Public.

Description

impl/memory: Fix memcache stats race. Fix a race in memcache stats that was caused by modification of common stats varibles while holding a possibly-shared RLock. This fix switches locking from RWMutex to Mutex, since potentially every access contains mutations to the shared state. BUG=None TEST=local - Re-ran external test with fix, race no longer triggered. R=iannucci@chromium.org Committed: https://github.com/luci/gae/commit/c12ab6ff5cb4e6d9f78c89a172f8cc08bcdf56d5

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -5 lines) Patch
M impl/memory/memcache.go View 3 chunks +5 lines, -5 lines 1 comment Download

Messages

Total messages: 9 (3 generated)
dnj
4 years ago (2016-12-06 06:21:22 UTC) #1
dnj
PTAL. Stupid problem, stupid fix. I actually implemented a pretty nice sync/atomic solution and kept ...
4 years ago (2016-12-06 06:22:45 UTC) #2
iannucci
Hm... I'm not sure I understand WHY there was a race, or why this fixes ...
4 years ago (2016-12-06 06:25:33 UTC) #3
dnj
https://codereview.chromium.org/2554793002/diff/1/impl/memory/memcache.go File impl/memory/memcache.go (right): https://codereview.chromium.org/2554793002/diff/1/impl/memory/memcache.go#newcode110 impl/memory/memcache.go:110: m.stats.Items++ All mutations to "m.stats" while holding RLock are ...
4 years ago (2016-12-06 17:24:06 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2554793002/1
4 years ago (2016-12-06 17:24:46 UTC) #6
commit-bot: I haz the power
4 years ago (2016-12-06 17:29:05 UTC) #9
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://github.com/luci/gae/commit/c12ab6ff5cb4e6d9f78c89a172f8cc08bcdf56d5

Powered by Google App Engine
This is Rietveld 408576698