You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2015/10/21 21:06:52 UTC
mesos git commit: Slave should accept PingSlaveMessage but not "PING"
message.
Repository: mesos
Updated Branches:
refs/heads/master 901b9b8bb -> cfb901d2b
Slave should accept PingSlaveMessage but not "PING" message.
Review: https://reviews.apache.org/r/39516
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/cfb901d2
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/cfb901d2
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/cfb901d2
Branch: refs/heads/master
Commit: cfb901d2b25cbb276f7b3306f97867a6012b9e87
Parents: 901b9b8
Author: Yong Qiao Wang <yq...@cn.ibm.com>
Authored: Wed Oct 21 12:03:56 2015 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Wed Oct 21 12:04:00 2015 -0700
----------------------------------------------------------------------
src/master/master.cpp | 9 ---------
src/slave/slave.cpp | 45 ---------------------------------------------
src/slave/slave.hpp | 3 ---
3 files changed, 57 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/cfb901d2/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 2cc8147..0981428 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -143,10 +143,6 @@ public:
pinged(false),
connected(true)
{
- // TODO(Wang Yong Qiao): For backwards compatibility, this handler is kept.
- // Suggest to remove this handler in 0.26.0.
- install("PONG", &SlaveObserver::pongOld);
-
install<PongSlaveMessage>(&SlaveObserver::pong);
}
@@ -176,11 +172,6 @@ protected:
delay(slavePingTimeout, self(), &SlaveObserver::timeout);
}
- void pongOld(const UPID& from, const string& body)
- {
- pong();
- }
-
void pong()
{
timeouts = 0;
http://git-wip-us.apache.org/repos/asf/mesos/blob/cfb901d2/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 6526976..e9f2d1b 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -503,11 +503,6 @@ void Slave::initialize()
&Slave::shutdown,
&ShutdownMessage::message);
- // Install the ping message handler.
- // TODO(vinod): Remove this handler in 0.22.0 in favor of the
- // new PingSlaveMessage handler.
- install("PING", &Slave::pingOld);
-
install<PingSlaveMessage>(
&Slave::ping,
&PingSlaveMessage::connected);
@@ -3167,46 +3162,6 @@ void Slave::executorMessage(
metrics.valid_framework_messages++;
}
-
-void Slave::pingOld(const UPID& from, const string& body)
-{
- VLOG(1) << "Received ping from " << from;
-
- if (!body.empty()) {
- // This must be a ping from 0.21.0 master.
- PingSlaveMessage message;
- CHECK(message.ParseFromString(body))
- << "Invalid ping message '" << body << "' from " << from;
-
- if (!message.connected() && state == RUNNING) {
- // This could happen if there is a one way partition between
- // the master and slave, causing the master to get an exited
- // event and marking the slave disconnected but the slave
- // thinking it is still connected. Force a re-registration with
- // the master to reconcile.
- LOG(INFO) << "Master marked the slave as disconnected but the slave"
- << " considers itself registered! Forcing re-registration.";
- detection.discard();
- }
- }
-
- // If we don't get a ping from the master, trigger a
- // re-registration. This can occur when the master no
- // longer considers the slave to be registered, so it is
- // essential for the slave to attempt a re-registration
- // when this occurs.
- Clock::cancel(pingTimer);
-
- pingTimer = delay(
- masterPingTimeout,
- self(),
- &Slave::pingTimeout,
- detection);
-
- send(from, "PONG");
-}
-
-
void Slave::ping(const UPID& from, bool connected)
{
VLOG(1) << "Received ping from " << from;
http://git-wip-us.apache.org/repos/asf/mesos/blob/cfb901d2/src/slave/slave.hpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp
index 04a8646..70342cb 100644
--- a/src/slave/slave.hpp
+++ b/src/slave/slave.hpp
@@ -183,9 +183,6 @@ public:
const ExecutorID& executorId,
const std::string& data);
- // TODO(vinod): Remove this in 0.23.0.
- void pingOld(const process::UPID& from, const std::string& body);
-
// NOTE: This handler is added to make it easy for upgrading slaves
// and masters to 0.22.0. A 0.22.0 master will send PingSlaveMessage
// which will call this method.