Skip to content

Commit 2f2811d

Browse files
committed
Adding logs for ipam state
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
1 parent 60d8639 commit 2f2811d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libnetwork/bitseq/sequence.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ func (h *Handle) set(ordinal, start, end uint64, any bool, release bool, serial
326326
}
327327
h.Lock() // Acquire the lock back
328328
}
329-
logrus.Debugf("Received set for ordinal %v, start %v, end %v, any %t, release %t, serial:%v curr:%d \n", ordinal, start, end, any, release, serial, h.curr)
330329
if serial {
331330
curr = h.curr
332331
}
@@ -466,8 +465,8 @@ func (h *Handle) Unselected() uint64 {
466465
func (h *Handle) String() string {
467466
h.Lock()
468467
defer h.Unlock()
469-
return fmt.Sprintf("App: %s, ID: %s, DBIndex: 0x%x, bits: %d, unselected: %d, sequence: %s",
470-
h.app, h.id, h.dbIndex, h.bits, h.unselected, h.head.toString())
468+
return fmt.Sprintf("App: %s, ID: %s, DBIndex: 0x%x, Bits: %d, Unselected: %d, Sequence: %s Curr:%d",
469+
h.app, h.id, h.dbIndex, h.bits, h.unselected, h.head.toString(), h.curr)
471470
}
472471

473472
// MarshalJSON encodes Handle into json message

libnetwork/ipam/allocator.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ func (a *Allocator) ReleaseAddress(poolID string, address net.IP) error {
526526
return types.InternalErrorf("could not find bitmask in datastore for %s on address %v release from pool %s: %v",
527527
k.String(), address, poolID, err)
528528
}
529+
defer logrus.Debugf("Released address PoolID:%s, Address:%v Sequence:%s", poolID, address, bm.String())
529530

530531
return bm.Unset(ipToUint64(h))
531532
}
@@ -537,6 +538,7 @@ func (a *Allocator) getAddress(nw *net.IPNet, bitmask *bitseq.Handle, prefAddres
537538
base *net.IPNet
538539
)
539540

541+
logrus.Debugf("Request address PoolID:%v %s Serial:%v PrefAddress:%v ", nw, bitmask.String(), serial, prefAddress)
540542
base = types.GetIPNetCopy(nw)
541543

542544
if bitmask.Unselected() <= 0 {

0 commit comments

Comments
 (0)