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

IOSwitchboard doesn't properly flush data on ATTACH_CONTAINER_OUTPUT

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.2.0
    • None

    Description

      Currently we are doing a close on the write end of all connection pipes when we exit the switchboard, but we don't wait until the read is flushed before exiting. This can cause some data to get dropped since the process may exit before the reader is flushed. The current code is:

      void IOSwitchboardServerProcess::finalize()                                   
      { 
        foreach (HttpConnection& connection, outputConnections) {                   
          connection.close();                                              
        }                                                                           
        
        if (failure.isSome()) {
          promise.fail(failure->message);                                           
        } else {
          promise.set(Nothing());                                                   
        }                                                                           
      } 
      

      We should change it to:

      void IOSwitchboardServerProcess::finalize()                                   
      { 
        foreach (HttpConnection& connection, outputConnections) {                   
          connection.close();
          connection.closed().await();                                              
        }                                                                           
        
        if (failure.isSome()) {
          promise.fail(failure->message);                                           
        } else {
          promise.set(Nothing());                                                   
        }                                                                           
      } 
      

      Attachments

        Activity

          People

            anandmazumdar Anand Mazumdar
            klueska Kevin Klues
            Vinod Kone Vinod Kone
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: