From 1eb1abeedae36b390f5df02c0b6160cdd69c41b9 Mon Sep 17 00:00:00 2001 From: "fupan.lfp" Date: Thu, 7 May 2020 18:44:04 +0800 Subject: [PATCH] channel: fix the issue of epoll_wait interrupted by signal The epoll_wait syscall would be interrupted by signal, thus it's better to ignore this interrupted error. Fixes: #779 Signed-off-by: fupan.lfp --- channel.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/channel.go b/channel.go index 05662f362..253ef8b5a 100644 --- a/channel.go +++ b/channel.go @@ -14,6 +14,7 @@ import ( "os" "path/filepath" "strings" + "syscall" "time" "github.com/hashicorp/yamux" @@ -194,6 +195,10 @@ func (c *serialChannel) wait() error { for { nev, err := unix.EpollWait(epfd, events[:], -1) if err != nil { + if err == syscall.EINTR { + continue + } + return err }