avoid performing garbage collect on each topology update#118
avoid performing garbage collect on each topology update#118
Conversation
|
I think I would be happier if we did a garabgeCollect somewhere. |
9665e4a to
1bb1ce4
Compare
|
Updated PR to perform garbage collect corresponding to topology updates. Also timer is used trigger garbage collect at scheduled interval which will help coalesce topology updates. |
|
addressed review comments. PTAL |
25e492a to
b0ea3b3
Compare
gossip_test.go
Outdated
| } | ||
| } | ||
| // Allow topology to propagate | ||
| time.Sleep(1 * time.Second) |
There was a problem hiding this comment.
I don't like this - sendPendingGossip() is carefully written to wait long enough already.
You could add a new function in peers_test.go like:
func forcePendingGC(routers ...*Router) {
for _, router := range routers {
router.Peers.Lock()
if router.Peers.pendingGC {
var pending peersPendingNotifications
router.Peers.garbageCollect(&pending)
router.Peers.unlockAndNotify(&pending)
} else {
router.Peers.Unlock()
}
}
}then call it as necessary?
|
I note we can't run |
Fixes: #115