Merge pull request #1228 from weaveworks/1030-150-connect-forget
Don't init the ring if the address is not in range. Fixes #1030.
This commit is contained in:
commit
820307dd4e
3 files changed
+4
-1
No files matched your search
@@ -35,6 +35,8 @@ func (g *allocate) Try(alloc *Allocator) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
alloc.establishRing()
|
||||
|
||||
if ok, addr := alloc.space.Allocate(g.r); ok {
|
||||
alloc.debugln("Allocated", addr, "for", g.ident, "in", g.r)
|
||||
alloc.addOwned(g.ident, addr)
|
||||
|
||||
@@ -95,7 +95,6 @@ func (alloc *Allocator) doOperation(op operation, ops *[]operation) {
|
||||
op.Cancel()
|
||||
return
|
||||
}
|
||||
alloc.establishRing()
|
||||
if !op.Try(alloc) {
|
||||
*ops = append(*ops, op)
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ func (c *claim) Try(alloc *Allocator) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
alloc.establishRing()
|
||||
|
||||
switch owner := alloc.ring.Owner(c.addr); owner {
|
||||
case alloc.ourName:
|
||||
// success
|
||||
|
||||
Reference in new issue
Block a user