more validation in pending hostmap deletes (#344)

We are currently seeing some cases where we are not deleting entries
correctly from the pending hostmap. I believe this is a case of
an inbound timer tick firing and deleting the Hosts map entry for
a newer handshake attempt than intended, thus leaving the old Indexes
entry orphaned. This change adds some extra checking when deleteing from
the Indexes and Hosts maps to ensure we clean everything up correctly.
This commit is contained in:
Wade Simmons
2021-03-01 12:40:46 -05:00
committed by GitHub
parent 73081d99bc
commit 1bae5b2550
3 changed files with 52 additions and 8 deletions

View File

@ -181,11 +181,7 @@ func (c *HandshakeManager) NextInboundHandshakeTimerTick(now time.Time) {
}
index := ep.(uint32)
hostinfo, err := c.pendingHostMap.QueryIndex(index)
if err != nil {
continue
}
c.pendingHostMap.DeleteHostInfo(hostinfo)
c.pendingHostMap.DeleteIndex(index)
}
}