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

Side by Side Diff: filter/dscache/support.go

Issue 1987353002: dscache: Reduce log level of memcache failures. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« filter/dscache/doc.go ('K') | « filter/dscache/ds.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package dscache 5 package dscache
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "math/rand" 9 "math/rand"
10 "time" 10 "time"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if err := s.mc.SetMulti(lockItems); err != nil { 112 if err := s.mc.SetMulti(lockItems); err != nil {
113 // this is a hard failure. No mutation can occur if we're unable to set 113 // this is a hard failure. No mutation can occur if we're unable to set
114 // locks out. See "DANGER ZONE" in the docs. 114 // locks out. See "DANGER ZONE" in the docs.
115 (log.Fields{log.ErrorKey: err}).Errorf( 115 (log.Fields{log.ErrorKey: err}).Errorf(
116 s.c, "dscache: HARD FAILURE: supportContext.mutation(): mc.SetMulti") 116 s.c, "dscache: HARD FAILURE: supportContext.mutation(): mc.SetMulti")
117 return err 117 return err
118 } 118 }
119 err := f() 119 err := f()
120 if err == nil { 120 if err == nil {
121 if err := errors.Filter(s.mc.DeleteMulti(lockKeys), memcache.Err CacheMiss); err != nil { 121 if err := errors.Filter(s.mc.DeleteMulti(lockKeys), memcache.Err CacheMiss); err != nil {
122 » » » (log.Fields{log.ErrorKey: err}).Warningf( 122 » » » (log.Fields{log.ErrorKey: err}).Debugf(
123 s.c, "dscache: mc.DeleteMulti") 123 s.c, "dscache: mc.DeleteMulti")
124 } 124 }
125 } 125 }
126 return err 126 return err
127 } 127 }
128 128
129 func (s *supportContext) mkRandLockItems(keys []*ds.Key, metas ds.MultiMetaGette r) ([]memcache.Item, []byte) { 129 func (s *supportContext) mkRandLockItems(keys []*ds.Key, metas ds.MultiMetaGette r) ([]memcache.Item, []byte) {
130 mcKeys := s.mkRandKeys(keys, metas) 130 mcKeys := s.mkRandKeys(keys, metas)
131 if len(mcKeys) == 0 { 131 if len(mcKeys) == 0 {
132 return nil, nil 132 return nil, nil
(...skipping 18 matching lines...) Expand all
151 return nil, nil 151 return nil, nil
152 } 152 }
153 ret := make([]memcache.Item, len(mcKeys)) 153 ret := make([]memcache.Item, len(mcKeys))
154 for i := range ret { 154 for i := range ret {
155 ret[i] = (s.mc.NewItem(mcKeys[i]). 155 ret[i] = (s.mc.NewItem(mcKeys[i]).
156 SetFlags(uint32(ItemHasLock)). 156 SetFlags(uint32(ItemHasLock)).
157 SetExpiration(time.Second * time.Duration(LockTimeSecond s))) 157 SetExpiration(time.Second * time.Duration(LockTimeSecond s)))
158 } 158 }
159 return ret, mcKeys 159 return ret, mcKeys
160 } 160 }
OLDNEW
« filter/dscache/doc.go ('K') | « filter/dscache/ds.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698