test/net-pool #2
@@ -335,8 +335,8 @@ func (p *SyncedPool) Negotiate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *SyncedPool) GetHealthyRemotes() []*RemoteHost {
|
func (p *SyncedPool) GetHealthyRemotes() []*RemoteHost {
|
||||||
// p.mu.RLock()
|
p.mu.RLock()
|
||||||
// defer p.mu.RUnlock()
|
defer p.mu.RUnlock()
|
||||||
remotes := make([]*RemoteHost, 0, len(p.remotes))
|
remotes := make([]*RemoteHost, 0, len(p.remotes))
|
||||||
for _, r := range p.remotes {
|
for _, r := range p.remotes {
|
||||||
if r.IsHealthy() {
|
if r.IsHealthy() {
|
||||||
@@ -351,10 +351,7 @@ func (p *SyncedPool) RequestOwnership(id CartId) error {
|
|||||||
all := 0
|
all := 0
|
||||||
|
|
||||||
for _, r := range p.GetHealthyRemotes() {
|
for _, r := range p.GetHealthyRemotes() {
|
||||||
if !r.IsHealthy() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
//log.Printf("Asking for confirmation change of %s to %s (me) with %s\n", id, p.Hostname, r.Host)
|
|
||||||
err := r.ConfirmChange(id, p.Hostname)
|
err := r.ConfirmChange(id, p.Hostname)
|
||||||
all++
|
all++
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user