Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Mesosphere Sprint 47
-
1
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()); } }