[Libguestfs] [PATCH libnbd 1/2] golang/tests: Retry syscall.Select on EINTR

Eric Blake eblake at redhat.com
Thu Oct 28 12:40:57 UTC 2021


On Sat, Oct 23, 2021 at 11:47:41PM +0300, Nir Soffer wrote:
> Go syscall package does not handle EINTR like higher level packages, so
> we need to handle it when using syscall.Select().
> 
> The test always fails when running:
> 
>     $ GOLANG=go pkg=libguestfs.org/libnbd ./run-tests.sh
>     ...
>     === RUN   Test590AioCopy
>         libnbd_590_aio_copy_test.go:160: select: interrupted system call
> 
> Strangely, it never fails when running "make check".

It may be a situation where executing the test directly causes a
different set of default signal handlers to be inherited into the
child process than when running under make (never a fun situation to
debug or actually prove).  Syscalls should only be able to fail with
EINTR based on when a program has installed non-default signal
handlers, but whether they do that may in turn depend on what they
inherit from the parent process.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




More information about the Libguestfs mailing list