Kevin Klues created MESOS-6746:
----------------------------------

             Summary: IOSwitchboard doesn't properly flush data on 
ATTACH_CONTAINER_OUTPUT
                 Key: MESOS-6746
                 URL: https://issues.apache.org/jira/browse/MESOS-6746
             Project: Mesos
          Issue Type: Bug
            Reporter: Kevin Klues
            Assignee: Anand Mazumdar


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

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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to