We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d62b42a + 30837c0 commit c902e72Copy full SHA for c902e72
1 file changed
pkg/hostagent/inotify.go
@@ -35,6 +35,14 @@ func (a *HostAgent) startInotify(ctx context.Context) error {
35
// goroutine; without notify.Stop they leak for the lifetime of the process.
36
defer notify.Stop(mountWatchCh)
37
38
+ // PostInotify returns a usable stream wrapper before the server-side
39
+ // handler is installed, so Sends issued during the gap fail with EOF.
40
+ select {
41
+ case <-a.guestAgentAliveCh:
42
+ case <-ctx.Done():
43
+ return nil
44
+ }
45
+
46
client, err := a.getOrCreateClient(ctx)
47
if err != nil {
48
return fmt.Errorf("inotify: failed to obtain guest agent client: %w", err)
0 commit comments