From 6abb4405c8e162f087d69945f88ab8f59b2e62a6 Mon Sep 17 00:00:00 2001 From: Danil Uzlov Date: Fri, 23 Apr 2021 14:57:46 +0700 Subject: [PATCH 1/3] Fix race in networkservice/core/adapters/monitor_server_to_client.go Signed-off-by: Danil Uzlov --- pkg/networkservice/core/adapters/monitor_server_to_client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/networkservice/core/adapters/monitor_server_to_client.go b/pkg/networkservice/core/adapters/monitor_server_to_client.go index a4716fdb2..fa589f121 100644 --- a/pkg/networkservice/core/adapters/monitor_server_to_client.go +++ b/pkg/networkservice/core/adapters/monitor_server_to_client.go @@ -18,6 +18,7 @@ package adapters import ( "context" + "runtime" "github.com/networkservicemesh/api/pkg/api/networkservice" "google.golang.org/grpc" @@ -41,5 +42,8 @@ func (m *monitorServerToClient) MonitorConnections(ctx context.Context, selector go func() { _ = m.server.MonitorConnections(selector, srv) }() + for len(eventCh) == 0 { + runtime.Gosched() + } return eventchannel.NewMonitorConnectionMonitorConnectionsClient(ctx, eventCh), nil } From 572010a2fa0e73352d4cf5557a4f079d075112f1 Mon Sep 17 00:00:00 2001 From: Danil Uzlov Date: Fri, 23 Apr 2021 16:05:19 +0700 Subject: [PATCH 2/3] fix copyright notice Signed-off-by: Danil Uzlov --- pkg/networkservice/core/adapters/monitor_server_to_client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/networkservice/core/adapters/monitor_server_to_client.go b/pkg/networkservice/core/adapters/monitor_server_to_client.go index fa589f121..ef5794c4c 100644 --- a/pkg/networkservice/core/adapters/monitor_server_to_client.go +++ b/pkg/networkservice/core/adapters/monitor_server_to_client.go @@ -1,3 +1,5 @@ +// Copyright (c) 2021 Doc.ai and/or its affiliates. +// // Copyright (c) 2020 Cisco and/or its affiliates. // // SPDX-License-Identifier: Apache-2.0 From 25492cd8c892782f92ba49c8bff5c73f877604e6 Mon Sep 17 00:00:00 2001 From: Danil Uzlov Date: Fri, 23 Apr 2021 16:58:19 +0700 Subject: [PATCH 3/3] fix copyright notice Signed-off-by: Danil Uzlov --- pkg/networkservice/core/adapters/monitor_server_to_client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/networkservice/core/adapters/monitor_server_to_client.go b/pkg/networkservice/core/adapters/monitor_server_to_client.go index ef5794c4c..d78af8670 100644 --- a/pkg/networkservice/core/adapters/monitor_server_to_client.go +++ b/pkg/networkservice/core/adapters/monitor_server_to_client.go @@ -1,7 +1,7 @@ -// Copyright (c) 2021 Doc.ai and/or its affiliates. -// // Copyright (c) 2020 Cisco and/or its affiliates. // +// Copyright (c) 2021 Doc.ai and/or its affiliates. +// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License");