Skip to content
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

conmon: drop usage of splice(2) #131

Merged
merged 3 commits into from
Mar 20, 2020

Commits on Mar 18, 2020

  1. .dir-locals.el: new file

    Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
    giuseppe committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    a2e1060 View commit details
    Browse the repository at this point in the history
  2. conmon: drop usage of splice(2)

    splice(2) doesn't seem to handle correctly sockets having a type of
    SOCK_SEQPACKET.
    
    When using a SOCK_SEQPACKET, each read is limited to the current
    packet.  The data that doesn't fit in a single read(2) call will be
    discarded.  This can be a problem when the fd_out doesn't accept all
    the data, so on a short write we lose the data that could not be
    written by the splice(2) call.
    
    Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
    giuseppe committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    6da0481 View commit details
    Browse the repository at this point in the history
  3. conmon: avoid hanging on stdin

    now that we dropped splice(2), we need to make sure the read/write
    loop doesn't hang indefinitely conmon.
    
    Attempting to write to a fd that is not ready for write causes conmon
    to block on the write(2) call, at the same time the container process
    might be blocked attempting to write to stderr but since conmon is not
    processing any data from the container, both processes are dead
    locked.
    
    Keep in a buffer what we read from the pipe and write to the
    masterfd_stdin only when it is ready for write.
    
    Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
    giuseppe committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    6cf14cb View commit details
    Browse the repository at this point in the history