Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangxu19830126 committed Jul 18, 2018
1 parent d8e9bcc commit 04af785
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/proxy/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ func (r *dispatcher) addToCheck(svr *serverRuntime) {
}

func (r *dispatcher) heathCheckTimeout(arg interface{}) {
r.checkerC <- arg.(uint64)
id := arg.(uint64)
r.RLock()
_, ok := r.servers[id]
r.RUnlock()
if ok {
r.checkerC <- id
}
}

func (r *dispatcher) check(id uint64) {
Expand Down
1 change: 1 addition & 0 deletions pkg/proxy/dispatcher_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ func (r *dispatcher) removeServer(id uint64) error {
return errServerNotFound
}

svr.heathTimeout.Stop()
delete(r.servers, id)
for _, cluster := range r.clusters {
cluster.remove(id)
Expand Down

0 comments on commit 04af785

Please sign in to comment.