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:34 UTC
[mesos] branch 1.6.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.6.x
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/1.6.x by this push:
new 7a59b0e Added defer to dispatch lambdas onto PID.
7a59b0e is described below
commit 7a59b0e59a62f066e68c1c5964160c36f6d68512
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 4b50dcb..36fb26f 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -1627,7 +1627,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 0677eb4..0afdce8 100644
--- a/src/slave/http.cpp
+++ b/src/slave/http.cpp
@@ -3054,7 +3054,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;
@@ -3100,7 +3100,7 @@ Future<Response> Http::_attachContainerInput(
// responses due to a lack of graceful shutdown in libprocess.
acknowledgeContainerInputResponse(containerId);
}));
- });
+ }));
}