Skip to content

periodic reload slot table loop does not work #2

@sayto

Description

@sayto

When one of nodes valkey cluster become fail, func Dispatcher.reloadTopology() does not start.

Problen in func slotsReloadLoop - it stars once

for range time.After(d.slotReloadInterval) can trigger onlu one event

my fix is:

-       periodicReloadInterval := 60 * time.Second
-       for range time.After(d.slotReloadInterval) {
+       for {
                select {
                case _, ok := <-d.slotReloadChan:
                        if !ok {
@@ -122,7 +121,7 @@ func (d *Dispatcher) slotsReloadLoop() {
                        } else {
                                d.slotInfoChan <- slotInfos
                        }
-               case <-time.After(periodicReloadInterval):
+               case <-time.After(d.slotReloadInterval):
                        glog.Infof("periodic reload triggered")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions