mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
iptables testing: handle EINTR on calls to accept().
This caused test flakes. PiperOrigin-RevId: 338758723
This commit is contained in:
committed by
Nicolas Lacasse
parent
e5c1b035ab
commit
a04c8ad4ce
+11
-4
@@ -577,11 +577,18 @@ func listenForRedirectedConn(ctx context.Context, ipv6 bool, originalDsts []net.
|
||||
connCh := make(chan int)
|
||||
errCh := make(chan error)
|
||||
go func() {
|
||||
connFD, _, err := syscall.Accept(sockfd)
|
||||
if err != nil {
|
||||
errCh <- err
|
||||
for {
|
||||
connFD, _, err := syscall.Accept(sockfd)
|
||||
if errors.Is(err, syscall.EINTR) {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
errCh <- err
|
||||
return
|
||||
}
|
||||
connCh <- connFD
|
||||
return
|
||||
}
|
||||
connCh <- connFD
|
||||
}()
|
||||
|
||||
// Wait for accept() to return or for the context to finish.
|
||||
|
||||
Reference in New Issue
Block a user