-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Labels
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.
Description
There could be a race condition where a DIAL_CLS
packet from the frontend is received at the same time as a DIAL_RSP
from the backend that could lead to the backend connection being leaked:
This could happen if the following conditions happen in this order:
- DIAL_RSP received from the backend
- The pending dial is still present in
apiserver-network-proxy/pkg/server/server.go
Line 755 in b5e5436
if frontend, ok := s.PendingDial.Get(resp.Random); !ok { - Frontend starts shutting down, sends a DIAL_CLS (prior to [konnectivity-client] Ensure grpc tunnel is closed on dial failure #398 it wouldn't even send a close request)
- Server sends the dial response the frontend - The FE gRPC stream is still open so the packet is received, but the frontend doesn't process it:
apiserver-network-proxy/pkg/server/server.go
Line 767 in b5e5436
err := frontend.send(pkt) - At this point, the server thinks the connection is established, but the frontend is not aware of that, and in the process of shutting down, leading to a leaked backend connection.
This seems fairly unlikely (at least once #403 is fixed), but worth tracking.
Metadata
Metadata
Assignees
Labels
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.