You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/08/02 22:27:59 UTC

[1/2] mesos git commit: Fixed continuation logic in logrotate module.

Repository: mesos
Updated Branches:
  refs/heads/master e1cb01a15 -> b7d3e2150


Fixed continuation logic in logrotate module.

Previously the module's inner loop followed via `.then([=]`
which potentially executes the continuation on a different process.
This patch fixes this behavior (it should run on the same process)
and future-proofs this code in case the module is extended with
additional processes/behavior.

Review: https://reviews.apache.org/r/50664/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b7d3e215
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b7d3e215
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b7d3e215

Branch: refs/heads/master
Commit: b7d3e21506760750a621ba7eaef88a7e96d12f88
Parents: 0a7d819
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Tue Aug 2 15:21:52 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Aug 2 15:27:44 2016 -0700

----------------------------------------------------------------------
 src/slave/container_loggers/logrotate.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b7d3e215/src/slave/container_loggers/logrotate.cpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/logrotate.cpp b/src/slave/container_loggers/logrotate.cpp
index b863d93..89ea6cc 100644
--- a/src/slave/container_loggers/logrotate.cpp
+++ b/src/slave/container_loggers/logrotate.cpp
@@ -21,6 +21,7 @@
 #include <functional>
 #include <string>
 
+#include <process/defer.hpp>
 #include <process/dispatch.hpp>
 #include <process/io.hpp>
 #include <process/process.hpp>
@@ -107,7 +108,7 @@ public:
   void loop()
   {
     io::read(STDIN_FILENO, buffer, length)
-      .then([&](size_t readSize) -> Future<Nothing> {
+      .then(defer(self(), [&](size_t readSize) -> Future<Nothing> {
         // Check if EOF has been reached on the input stream.
         // This indicates that the container (whose logs are being
         // piped to this process) has exited.
@@ -128,7 +129,7 @@ public:
         dispatch(self(), &LogrotateLoggerProcess::loop);
 
         return Nothing();
-      });
+      }));
   }
 
   // Writes the buffer from stdin to the leading log file.


[2/2] mesos git commit: Fixed `clean-python` Makefile target.

Posted by jo...@apache.org.
Fixed `clean-python` Makefile target.

Our usage of `find ... -exec` did not take into account the order of
operations in `find`.  The placement of `-exec` at the end meant that
only the `*.egg-info` files were being deleted.

Adding parentheses around all the `-o` operators fixes what is being
deleted.

Review: https://reviews.apache.org/r/50717/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0a7d8194
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0a7d8194
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0a7d8194

Branch: refs/heads/master
Commit: 0a7d819428f7e033077c968ce6a010995e96f05d
Parents: e1cb01a
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Tue Aug 2 15:21:45 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Aug 2 15:27:44 2016 -0700

----------------------------------------------------------------------
 src/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0a7d8194/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 30d8f72..1a9b083 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1843,8 +1843,8 @@ all-local: $(MESOS_EGGS)
 endif # HAS_PYTHON
 
 clean-python:
-	find python -name "build" -o -name "dist" -o -name "*.pyc"	\
-	  -o -name "*.egg-info" -exec rm -rf '{}' \+
+	find python \( -name "build" -o -name "dist" -o -name "*.pyc"	\
+	  -o -name "*.egg-info" \) -exec rm -rf '{}' \+
 
 PHONY_TARGETS += clean-python