From 99fce7d68cfc6f3acd993cfef02d3f41dcbb7549 Mon Sep 17 00:00:00 2001 From: Kevin Parsons Date: Fri, 30 Nov 2018 12:42:06 -0800 Subject: [PATCH] Don't attempt to write to callback channels that we don't support --- internal/hcs/callback.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/hcs/callback.go b/internal/hcs/callback.go index e41c40ec8f..5119c25553 100644 --- a/internal/hcs/callback.go +++ b/internal/hcs/callback.go @@ -5,6 +5,7 @@ import ( "syscall" "github.com/Microsoft/hcsshim/internal/interop" + "github.com/sirupsen/logrus" ) var ( @@ -75,7 +76,13 @@ func notificationWatcher(notificationType hcsNotification, callbackNumber uintpt return 0 } - context.channels[notificationType] <- result + if channel, ok := context.channels[notificationType]; ok { + channel <- result + } else { + logrus.WithFields(logrus.Fields{ + "notification-type": notificationType, + }).Warn("Received a callback of an unsupported type") + } return 0 }