Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
device: do not close notify channel when wait timeout
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bergwolf committed Sep 7, 2018
1 parent e3eb9ce commit 3441244
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion device.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ func getPCIDeviceName(s *sandbox, pciID string) (string, error) {
case <-time.After(time.Duration(timeoutHotplug) * time.Second):
s.Lock()
delete(s.deviceWatchers, pciAddr)
close(notifyChan)
s.Unlock()

return "", grpcStatus.Errorf(codes.DeadlineExceeded,
Expand Down

0 comments on commit 3441244

Please sign in to comment.