New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vsock: unexpected EWOULDBLOCK while reading from backing stream #3497
Comments
Hi @jackloomen |
We fixed a few months ago a problem with the vsock (not sure if it's the same one), but you can check this commit: firecracker-microvm/firecracker@38bc78b. Btw, we are now looking at upstreaming the vsock building blocks as part of rust-vmm. We will soon publish a design document. @sboeuf do you think you could also take a look? |
Definitely! Sounds great! |
@jackloomen could you have a quick try with #3517 and let me know if that fixes the issue for you? |
After applying the patch to 20.1 the issue could not be reproduced. |
When forwarding an epoll event from the unix muxer to the targeted connection event handler, the eventset the connection registered is forwarded instead of the actual epoll operation (IN/OUT). For example, if the connection was registered for EPOLLIN, and receives an EPOLLOUT, the connection will actually handle an EPOLLOUT. This is the root cause of previous bug, which caused the introduction of some workarounds (i.e: handling ewouldblock when reading after receiving EPOLLIN, which should never happen). When matching the connection, we retrieve and use the evset of the connection instead of the one passed as a parameter. The compiler does not complain for an unused variable because it was first logged in a debug! statement. This is an unfortunate naming mistake that caused a lot of problems. Fixes cloud-hypervisor#3497 Signed-off-by: Eduard Kyvenko <eduard.kyvenko@gmail.com> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
When forwarding an epoll event from the unix muxer to the targeted connection event handler, the eventset the connection registered is forwarded instead of the actual epoll operation (IN/OUT). For example, if the connection was registered for EPOLLIN, and receives an EPOLLOUT, the connection will actually handle an EPOLLOUT. This is the root cause of previous bug, which caused the introduction of some workarounds (i.e: handling ewouldblock when reading after receiving EPOLLIN, which should never happen). When matching the connection, we retrieve and use the evset of the connection instead of the one passed as a parameter. The compiler does not complain for an unused variable because it was first logged in a debug! statement. This is an unfortunate naming mistake that caused a lot of problems. Fixes cloud-hypervisor#3497 Signed-off-by: Eduard Kyvenko <eduard.kyvenko@gmail.com> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
When forwarding an epoll event from the unix muxer to the targeted connection event handler, the eventset the connection registered is forwarded instead of the actual epoll operation (IN/OUT). For example, if the connection was registered for EPOLLIN, and receives an EPOLLOUT, the connection will actually handle an EPOLLOUT. This is the root cause of previous bug, which caused the introduction of some workarounds (i.e: handling ewouldblock when reading after receiving EPOLLIN, which should never happen). When matching the connection, we retrieve and use the evset of the connection instead of the one passed as a parameter. The compiler does not complain for an unused variable because it was first logged in a debug! statement. This is an unfortunate naming mistake that caused a lot of problems. Fixes #3497 Signed-off-by: Eduard Kyvenko <eduard.kyvenko@gmail.com> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
When forwarding an epoll event from the unix muxer to the targeted connection event handler, the eventset the connection registered is forwarded instead of the actual epoll operation (IN/OUT). For example, if the connection was registered for EPOLLIN, and receives an EPOLLOUT, the connection will actually handle an EPOLLOUT. This is the root cause of previous bug, which caused the introduction of some workarounds (i.e: handling ewouldblock when reading after receiving EPOLLIN, which should never happen). When matching the connection, we retrieve and use the evset of the connection instead of the one passed as a parameter. The compiler does not complain for an unused variable because it was first logged in a debug! statement. This is an unfortunate naming mistake that caused a lot of problems. Fixes cloud-hypervisor#3497 Signed-off-by: Eduard Kyvenko <eduard.kyvenko@gmail.com> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> (cherry picked from commit c47ab55) Signed-off-by: Rob Bradford <robert.bradford@intel.com>
When forwarding an epoll event from the unix muxer to the targeted connection event handler, the eventset the connection registered is forwarded instead of the actual epoll operation (IN/OUT). For example, if the connection was registered for EPOLLIN, and receives an EPOLLOUT, the connection will actually handle an EPOLLOUT. This is the root cause of previous bug, which caused the introduction of some workarounds (i.e: handling ewouldblock when reading after receiving EPOLLIN, which should never happen). When matching the connection, we retrieve and use the evset of the connection instead of the one passed as a parameter. The compiler does not complain for an unused variable because it was first logged in a debug! statement. This is an unfortunate naming mistake that caused a lot of problems. Fixes #3497 Signed-off-by: Eduard Kyvenko <eduard.kyvenko@gmail.com> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> (cherry picked from commit c47ab55) Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Hi @sboeuf; I just opened an issue with a proposal for the vsock packet abstraction. Can you also have a look? Thank you! |
cloud-hypervisor v20.1.0
--vsock cid=3,socket=/path/v.sock
Reproduced with streaming uncompressed video/assets over waypipe (wayland over sockets)
Frequency of occurrence depends on size of window (and therefore bandwidth)
On host:
waypipe --socket /path/v.sock_5000 client &
On guest:
socat UNIX-LISTEN:/tmp/waypipe-server.sock,reuseaddr,fork VSOCK-CONNECT:2:5000,forever &
waypipe --no-gpu --socket /tmp/waypipe-server.sock --control /tmp/waypipe-ctrl.pipe --display /tmp/wayland-0 server -- sleep inf &
WAYLAND_DISPLAY=/tmp/wayland-0 mpv /path/to/4k_video.mp4
This times 1000.
The text was updated successfully, but these errors were encountered: