Skip to content

Commit 7f7d8e8

Browse files
committed
netstack: remove timed-out endpoints from pendingEndpoints queue.
When a handshake times out, the endpoint may remain stuck in the lEP's pendingEndpoints queue. Related to google#11536
1 parent b019448 commit 7f7d8e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/tcpip/transport/tcp/endpoint.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,14 @@ func (e *Endpoint) closePendingAcceptableConnectionsLocked() {
11561156
pendingEndpoints := e.acceptQueue.pendingEndpoints
11571157
e.acceptQueue.pendingEndpoints = nil
11581158

1159+
//Remove current EP from its lEP acceptQueue.pendingEndpoint if exists.
1160+
if e.h != nil && e.h.listenEP != nil {
1161+
lEP := e.h.listenEP
1162+
lEP.acceptMu.Lock()
1163+
delete(lEP.acceptQueue.pendingEndpoints, e)
1164+
lEP.acceptMu.Unlock()
1165+
}
1166+
11591167
completedEndpoints := make([]*Endpoint, 0, e.acceptQueue.endpoints.Len())
11601168
for n := e.acceptQueue.endpoints.Front(); n != nil; n = n.Next() {
11611169
completedEndpoints = append(completedEndpoints, n.Value.(*Endpoint))

0 commit comments

Comments
 (0)