mdlayher / vsock

Package vsock provides access to Linux VM sockets (AF_VSOCK) for communication between a hypervisor and its virtual machines. MIT Licensed.
MIT License
328 stars 65 forks source link

Handle EINTR during socket creation #41

Closed stgraber closed 3 years ago

stgraber commented 3 years ago

Signed-off-by: Stéphane Graber stgraber@ubuntu.com

stgraber commented 3 years ago

@mdlayher that one failure looks unrelated, it's caused by dependencies requiring a more recent version of Go than the one used.

mdlayher commented 3 years ago

Is socket creation a common enough event in your programs that you run into EINTR? I am surprised I haven't heard of this in my netlink library which uses the same pattern.

I would feel better about a for loop with continue on EINTR rather than a goto.

Regarding the CI build, it's fine in this case but I'd love to outright drop support for anything less than Go 1.12. Last I knew, LXD relied on Go 1.10/1.11 due to old Ubuntu LTS? Is this still an issue or can I start removing old code?

stgraber commented 3 years ago

@mdlayher LXD is now on 1.13 or newer so the old stuff can go away.

I hit EINTR very frequently on aarch64 machines for some reason, I've never seen it on x86_64 though. I looked at some other vsock implementation and EINTR was similarly retried there. I suspect interrupted syscalls later on are handled by the higher level net functions, it's just that initial socket creation one which isn't.

stgraber commented 3 years ago

@mdlayher updated to a for loop now

mdlayher commented 3 years ago

LXD is now on 1.13 or newer so the old stuff can go away.

Great news! I think this library could probably use a bit of love again to tear out the old version shims and then we can tag a v1.0.0.