You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2019/06/26 11:22:29 UTC
[mesos] branch master updated (9d2fcc7 -> fe7be97)
This is an automated email from the ASF dual-hosted git repository.
bbannier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git.
from 9d2fcc7 Added `ipc_mode` and `shm_size` fields into `LinuxInfo`.
new f046559 Removed const ref lifetime extension use in `slave::state::recover`.
new fe7be97 Sped up `SlaveTest.KillQueuedTaskDuringExecutorRegistration`.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/slave/state.cpp | 20 ++++++++++----------
src/tests/slave_tests.cpp | 11 ++++++++++-
2 files changed, 20 insertions(+), 11 deletions(-)
[mesos] 02/02: Sped up
`SlaveTest.KillQueuedTaskDuringExecutorRegistration`.
Posted by bb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit fe7be9701e92d863734621ae1a3d339bb8598044
Author: Benjamin Bannier <bb...@apache.org>
AuthorDate: Wed Jun 26 11:54:20 2019 +0200
Sped up `SlaveTest.KillQueuedTaskDuringExecutorRegistration`.
This patch switches `SlaveTest.KillQueuedTaskDuringExecutorRegistration`
to manual clock management with paused clock and manual clock advance.
This speeds up the test by >25x from >5s to <200ms on my machine in a
not-optimized build.
Review: https://reviews.apache.org/r/70935/
---
src/tests/slave_tests.cpp | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index c203597..7ba2df9 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -4300,6 +4300,8 @@ TEST_F(SlaveTest, KillMultiplePendingTasks)
// the executor.
TEST_F(SlaveTest, KillQueuedTaskDuringExecutorRegistration)
{
+ Clock::pause();
+
// Start a master.
Try<Owned<cluster::Master>> master = StartMaster();
ASSERT_SOME(master);
@@ -4310,9 +4312,14 @@ TEST_F(SlaveTest, KillQueuedTaskDuringExecutorRegistration)
Owned<MasterDetector> detector = master.get()->createDetector();
// Start a slave.
- Try<Owned<cluster::Slave>> slave = StartSlave(detector.get(), &containerizer);
+ slave::Flags slaveFlags = CreateSlaveFlags();
+ Try<Owned<cluster::Slave>> slave =
+ StartSlave(detector.get(), &containerizer, slaveFlags);
ASSERT_SOME(slave);
+ Clock::advance(slaveFlags.authentication_backoff_factor);
+ Clock::settle();
+
MockScheduler sched;
MesosSchedulerDriver driver(
&sched, DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
@@ -4376,6 +4383,8 @@ TEST_F(SlaveTest, KillQueuedTaskDuringExecutorRegistration)
slave.get()->pid,
registerExecutor);
+ Clock::advance(slaveFlags.executor_shutdown_grace_period);
+
AWAIT_READY(executorLost);
driver.stop();
[mesos] 01/02: Removed const ref lifetime extension use in
`slave::state::recover`.
Posted by bb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit f04655979cc8cd3fc3b263f42ef2df850ec8a933
Author: Benjamin Bannier <bb...@apache.org>
AuthorDate: Wed Jun 26 11:54:08 2019 +0200
Removed const ref lifetime extension use in `slave::state::recover`.
Review: https://reviews.apache.org/r/70912/
---
src/slave/state.cpp | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/slave/state.cpp b/src/slave/state.cpp
index b4bf629..e0a850e 100644
--- a/src/slave/state.cpp
+++ b/src/slave/state.cpp
@@ -85,7 +85,7 @@ Try<State> recover(const string& rootDir, bool strict)
// resources checkpoint file.
state.resources = resources.get();
- const string& bootIdPath = paths::getBootIdPath(rootDir);
+ const string bootIdPath = paths::getBootIdPath(rootDir);
if (os::exists(bootIdPath)) {
Result<string> read = state::read<string>(bootIdPath);
if (read.isError()) {
@@ -102,7 +102,7 @@ Try<State> recover(const string& rootDir, bool strict)
}
}
- const string& latest = paths::getLatestSlavePath(rootDir);
+ const string latest = paths::getLatestSlavePath(rootDir);
// Check if the "latest" symlink to a slave directory exists.
if (!os::exists(latest)) {
@@ -147,7 +147,7 @@ Try<SlaveState> SlaveState::recover(
state.id = slaveId;
// Read the slave info.
- const string& path = paths::getSlaveInfoPath(rootDir, slaveId);
+ const string path = paths::getSlaveInfoPath(rootDir, slaveId);
if (!os::exists(path)) {
// This could happen if the slave died before it registered with
// the master.
@@ -158,7 +158,7 @@ Try<SlaveState> SlaveState::recover(
Result<SlaveInfo> slaveInfo = state::read<SlaveInfo>(path);
if (slaveInfo.isError()) {
- const string& message = "Failed to read agent info from '" + path + "': " +
+ const string message = "Failed to read agent info from '" + path + "': " +
slaveInfo.error();
if (strict) {
return Error(message);
@@ -203,7 +203,7 @@ Try<SlaveState> SlaveState::recover(
state.errors += framework->errors;
}
- const string& resourceStatePath = paths::getResourceStatePath(rootDir);
+ const string resourceStatePath = paths::getResourceStatePath(rootDir);
if (os::exists(resourceStatePath)) {
Result<ResourceState> resourceState =
state::read<ResourceState>(resourceStatePath);
@@ -368,7 +368,7 @@ Try<ExecutorState> ExecutorState::recover(
// Recover the runs.
foreach (const string& path, runs.get()) {
if (Path(path).basename() == paths::LATEST_SYMLINK) {
- const Result<string>& latest = os::realpath(path);
+ const Result<string> latest = os::realpath(path);
if (!latest.isSome()) {
return Error(
"Failed to find latest run of executor '" +
@@ -417,7 +417,7 @@ Try<ExecutorState> ExecutorState::recover(
}
// Read the executor info.
- const string& path =
+ const string path =
paths::getExecutorInfoPath(rootDir, slaveId, frameworkId, executorId);
if (!os::exists(path)) {
// This could happen if the slave died after creating the executor
@@ -762,7 +762,7 @@ Try<ResourcesState> ResourcesState::recover(
{
ResourcesState state;
- const string& resourceStatePath = paths::getResourceStatePath(rootDir);
+ const string resourceStatePath = paths::getResourceStatePath(rootDir);
if (os::exists(resourceStatePath)) {
Result<ResourceState> resourceState =
state::read<ResourceState>(resourceStatePath);
@@ -790,7 +790,7 @@ Try<ResourcesState> ResourcesState::recover(
<< resourceStatePath << "'";
// Process the committed resources.
- const string& infoPath = paths::getResourcesInfoPath(rootDir);
+ const string infoPath = paths::getResourcesInfoPath(rootDir);
if (!os::exists(infoPath)) {
LOG(INFO) << "No committed checkpointed resources found at '"
<< infoPath << "'";
@@ -816,7 +816,7 @@ Try<ResourcesState> ResourcesState::recover(
}
// Process the target resources.
- const string& targetPath = paths::getResourcesTargetPath(rootDir);
+ const string targetPath = paths::getResourcesTargetPath(rootDir);
if (!os::exists(targetPath)) {
return state;
}