You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2018/09/18 19:10:48 UTC
[mesos] branch 1.5.x updated: Added defer to dispatch lambdas onto
PID.
This is an automated email from the ASF dual-hosted git repository.
alexr pushed a commit to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/1.5.x by this push:
new 902aa34 Added defer to dispatch lambdas onto PID.
902aa34 is described below
commit 902aa34b79937841f24ef09b0afa5547221b1336
Author: Alexander Rukletsov <al...@apache.org>
AuthorDate: Tue Sep 18 21:08:32 2018 +0200
Added defer to dispatch lambdas onto PID.
(cherry picked from commit d4684872300ed228a981bdefbdbfbefa3d52eb30)
---
src/slave/containerizer/mesos/io/switchboard.cpp | 4 +++-
src/slave/http.cpp | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/slave/containerizer/mesos/io/switchboard.cpp b/src/slave/containerizer/mesos/io/switchboard.cpp
index 7db7c3e..91c14b1 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -1608,7 +1608,9 @@ IOSwitchboardServerProcess::acknowledgeContainerInputResponse()
// might get `HTTP 500` "broken pipe" while attempting to write the final
// message.
if (!redirectFinished.future().isPending() || failure.isSome()) {
- after(Seconds(1)).onAny([=]() { terminate(self(), false); });
+ after(Seconds(1)).onAny(defer(self(), [=](const Future<Nothing>&) {
+ terminate(self(), false);
+ }));
}
}
return http::OK();
diff --git a/src/slave/http.cpp b/src/slave/http.cpp
index 498f4f0..1c98cea 100644
--- a/src/slave/http.cpp
+++ b/src/slave/http.cpp
@@ -3194,7 +3194,7 @@ Future<Response> Http::_attachContainerInput(
std::move(decoder), encoder, writer);
return slave->containerizer->attach(containerId)
- .then([=](Connection connection) mutable {
+ .then(defer(slave->self(), [=](Connection connection) mutable {
Request request;
request.method = "POST";
request.type = Request::PIPE;
@@ -3240,7 +3240,7 @@ Future<Response> Http::_attachContainerInput(
// responses due to a lack of graceful shutdown in libprocess.
acknowledgeContainerInputResponse(containerId);
}));
- });
+ }));
}