[management] fix proxy conn lifecycle during acks (#8220)

This commit is contained in:
Pascal Fischer
2026-10-15 16:27:36 +02:00
committed by GitHub
parent dd830f0890
commit afd5c6df6a
3 changed files with 127 additions and 10 deletions
+8
View File
@@ -1303,6 +1303,10 @@ func (s *Server) proxyCapabilities() *proto.ProxyCapabilities {
}
func (s *Server) tryGetMappingUpdate(ctx context.Context, client proto.ProxyServiceClient, initialSyncDone *bool, onConnected func()) error {
// Canceling closes the stream on management; a bare return leaves it open.
ctx, cancel := context.WithCancel(ctx)
defer cancel()
connectTime := time.Now()
mappingClient, err := client.GetMappingUpdate(ctx, &proto.GetMappingUpdateRequest{
ProxyId: s.ID,
@@ -1325,6 +1329,10 @@ func (s *Server) tryGetMappingUpdate(ctx context.Context, client proto.ProxyServ
}
func (s *Server) trySyncMappings(ctx context.Context, client proto.ProxyServiceClient, initialSyncDone *bool, onConnected func()) error {
// Canceling closes the stream on management; a bare return leaves it open.
ctx, cancel := context.WithCancel(ctx)
defer cancel()
connectTime := time.Now()
stream, err := client.SyncMappings(ctx)
if err != nil {