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/05/29 09:46:29 UTC
[2/2] mesos git commit: Removed unchecked access to an optional in
checker process.
Removed unchecked access to an optional in checker process.
This could lead to an excutor crash when the id was set to
`None` between the check and the time it was accessed.
Review: https://reviews.apache.org/r/67345/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8fa4d322
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8fa4d322
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8fa4d322
Branch: refs/heads/master
Commit: 8fa4d322a0a4c6c87e21497559fd5d73ccc36133
Parents: c8ce487
Author: Benno Evers <be...@mesosphere.com>
Authored: Tue May 29 11:43:47 2018 +0200
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Tue May 29 11:43:47 2018 +0200
----------------------------------------------------------------------
src/checks/checker_process.cpp | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/8fa4d322/src/checks/checker_process.cpp
----------------------------------------------------------------------
diff --git a/src/checks/checker_process.cpp b/src/checks/checker_process.cpp
index c37a329..77a76f4 100644
--- a/src/checks/checker_process.cpp
+++ b/src/checks/checker_process.cpp
@@ -616,6 +616,8 @@ Future<int> CheckerProcess::nestedCommandCheck(
agent::Call call;
call.set_type(agent::Call::REMOVE_NESTED_CONTAINER);
+ mesos::ContainerID previousId = previousCheckContainerId.get();
+
agent::Call::RemoveNestedContainer* removeContainer =
call.mutable_remove_nested_container();
@@ -635,27 +637,25 @@ Future<int> CheckerProcess::nestedCommandCheck(
http::request(request, false)
.onFailed(defer(self(),
- [this, promise](const string& failure) {
+ [this, promise, previousId](const string& failure) {
LOG(WARNING) << "Connection to remove the nested container '"
- << previousCheckContainerId.get() << "' used for the "
- << name << " for task '" << taskId << "' failed: "
- << failure;
+ << previousId << "' used for the " << name << " for"
+ << " task '" << taskId << "' failed: " << failure;
// Something went wrong while sending the request, we treat this
// as a transient failure and discard the promise.
promise->discard();
}))
.onReady(defer(self(),
- [this, promise, cmd, nested]
+ [this, promise, cmd, nested, previousId]
(const http::Response& response) {
if (response.code != http::Status::OK) {
// The agent was unable to remove the check container, we
// treat this as a transient failure and discard the promise.
LOG(WARNING) << "Received '" << response.status << "' ("
<< response.body << ") while removing the nested"
- << " container '" << previousCheckContainerId.get()
- << "' used for the " << name << " for task '"
- << taskId << "'";
+ << " container '" << previousId << "' used for"
+ << " the " << name << " for task '" << taskId << "'";
promise->discard();
}