Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-8980

mesos-slave can deadlock with docker pull

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.1, 1.5.1, 1.6.0
    • 1.4.2, 1.5.2, 1.6.1, 1.7.0
    • None
    • None

    Description

      Similar to MESOS-1885.

      mesos-slave create pipes for stdout/stderr for docker pull, forks & execs docker pull. When the output of docker pull exceeds the buffer allocated to the pipe, mesos-slave and docker pull will deadlock, where docker pull blocks on writing to stdout, and mesos-slave is waiting for docker pull to exit.

      Under "normal" circumstances this seems somewhat rare, although if you have enough jobs running, you'll get to a point where the sum-total of buffer for pipes allocated gets to fs.pipe-max-size, at which point linux will give you a single page of memory for the pipe buffer, at which point a moderate amount of layers will push you over the 4k pipe buffer.

      Is stdout for docker pull being used for anything ? (Cursory testing & reading said no immediate observable harm). If not, the following should do the trick

      diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
      index d423d56ad..daebb897b 100755
      --- a/src/docker/docker.cpp
      +++ b/src/docker/docker.cpp
      @@ -1413,7 +1413,7 @@ Future<Docker::Image> Docker::__pull(
             path,
             argv,
             Subprocess::PATH("/dev/null"),
      -      Subprocess::PIPE(),
      +      Subprocess::PATH("/dev/null"),
             Subprocess::PIPE(),
             nullptr,
             environment);
      

      Attachments

        Activity

          People

            kjetijor Kjetil Joergensen
            kjetijor Kjetil Joergensen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: