Skip to content

Commit 3441244

Browse files
committed
device: do not close notify channel when wait timeout
Otherwise we might race with the uevent watcher and close the same channel twice, causing agent to crash like: msg="panic: close of nil channel\n" name=kata-proxy pid=38265 sandbox=6c9e75c9-9815-4e85-91da-2cb1bdebb085 source=agent msg="\n" name=kata-proxy pid=38265 sandbox=6c9e75c9-9815-4e85-91da-2cb1bdebb085 source=agent msg="goroutine 33 [running]:\n" name=kata-proxy pid=38265 sandbox=6c9e75c9-9815-4e85-91da-2cb1bdebb085 source=agent msg="main.getPCIDeviceName(0xc4200711e0, 0xc420013dfa, 0x5, 0x1, 0xc4201df188, 0x0, 0xc420072480)\n" name=kata-proxy pid=38265 sandbox=6c9e75c9-9815-4e85-91da-2cb1bdebb085 source=agent msg="\t/golang/src/github.com/kata-containers/agent/device.go:143 +0x4f9\n" name=kata-proxy pid=38265 sandbox=6c9e75c9-9815-4e85-91da-2cb1bdebb085 source=agent Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent e3eb9ce commit 3441244

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

device.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ func getPCIDeviceName(s *sandbox, pciID string) (string, error) {
140140
case <-time.After(time.Duration(timeoutHotplug) * time.Second):
141141
s.Lock()
142142
delete(s.deviceWatchers, pciAddr)
143-
close(notifyChan)
144143
s.Unlock()
145144

146145
return "", grpcStatus.Errorf(codes.DeadlineExceeded,

0 commit comments

Comments
 (0)