Fix access race in proxy scheduler

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan 2016-08-26 17:40:21 -07:00
parent 798b7331ca
commit dabdc5e52b

View file

@ -134,11 +134,12 @@ func (ttles *TTLExpirationScheduler) Start() error {
for {
select {
case <-ttles.saveTimer.C:
ttles.Lock()
if !ttles.indexDirty {
ttles.Unlock()
continue
}
ttles.Lock()
err := ttles.writeState()
if err != nil {
context.GetLogger(ttles.ctx).Errorf("Error writing scheduler state: %s", err)