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

Commit

Permalink
channel: fix the issue of epoll_wait interrupted by signal
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lifupan committed May 7, 2020
1 parent f481f6b commit 1eb1abe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"os"
"path/filepath"
"strings"
"syscall"
"time"

"github.com/hashicorp/yamux"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 1eb1abe

Please sign in to comment.