You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2016/12/07 21:43:43 UTC

mesos git commit: Made the IO Switchboard wait for the reader to signal before exiting.

Repository: mesos
Updated Branches:
  refs/heads/master f2adc8a95 -> a56734506


Made the IO Switchboard wait for the reader to signal before exiting.

The switchboard never used to wait for the read end of the pipe
to finish processing the data before exiting. This was problematic
as the client connected to the output entrypoint might not receive
the data. Note that we are relying on `socket.close()` to
eventually ensure that the data is flushed to the client when the
socket is closed.

Review: https://reviews.apache.org/r/54496/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a5673450
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a5673450
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a5673450

Branch: refs/heads/master
Commit: a56734506b666bebb1d16c437c78b7e79311bd4f
Parents: f2adc8a
Author: Anand Mazumdar <an...@apache.org>
Authored: Wed Dec 7 13:43:27 2016 -0800
Committer: Anand Mazumdar <an...@apache.org>
Committed: Wed Dec 7 13:43:27 2016 -0800

----------------------------------------------------------------------
 src/slave/containerizer/mesos/io/switchboard.cpp | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a5673450/src/slave/containerizer/mesos/io/switchboard.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/io/switchboard.cpp b/src/slave/containerizer/mesos/io/switchboard.cpp
index 34ef5f9..226bab8 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -1119,6 +1119,11 @@ void IOSwitchboardServerProcess::finalize()
 {
   foreach (HttpConnection& connection, outputConnections) {
     connection.close();
+
+    // It is possible that the read end of the pipe has not yet
+    // finished processing the data. We wait here for the reader
+    // to signal that is has finished reading.
+    connection.closed().await();
   }
 
   if (failure.isSome()) {