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:08:55 UTC
[mesos] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new d468487 Added defer to dispatch lambdas onto PID.
d468487 is described below
commit d4684872300ed228a981bdefbdbfbefa3d52eb30
Author: Alexander Rukletsov <al...@apache.org>
AuthorDate: Tue Sep 18 21:08:32 2018 +0200
Added defer to dispatch lambdas onto PID.
---
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 b1bd0c1..5bb21e7 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -1622,7 +1622,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 0a57741..bf34ef7 100644
--- a/src/slave/http.cpp
+++ b/src/slave/http.cpp
@@ -3096,7 +3096,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;
@@ -3142,7 +3142,7 @@ Future<Response> Http::_attachContainerInput(
// responses due to a lack of graceful shutdown in libprocess.
acknowledgeContainerInputResponse(containerId);
}));
- });
+ }));
}