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 2017/09/01 18:40:29 UTC

[1/2] mesos git commit: Added missing header to default executor tests.

Repository: mesos
Updated Branches:
  refs/heads/master 63d60ea0d -> 1ae308c2f


Added missing header to default executor tests.

This fixes the build on Windows but does not fix the newly
added test (which fails on Windows).


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

Branch: refs/heads/master
Commit: 5eca61ecd00dffb6aa54ac4cf350c515eaae1212
Parents: 63d60ea
Author: Joseph Wu <jo...@apache.org>
Authored: Fri Sep 1 09:57:51 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Fri Sep 1 11:39:06 2017 -0700

----------------------------------------------------------------------
 src/tests/default_executor_tests.cpp | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5eca61ec/src/tests/default_executor_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/default_executor_tests.cpp b/src/tests/default_executor_tests.cpp
index 8b6edf7..186b833 100644
--- a/src/tests/default_executor_tests.cpp
+++ b/src/tests/default_executor_tests.cpp
@@ -42,6 +42,7 @@
 #include <stout/path.hpp>
 
 #include <stout/os/exists.hpp>
+#include <stout/os/killtree.hpp>
 
 #include "slave/paths.hpp"
 


[2/2] mesos git commit: Windows: Fixed os::getenv to handle empty string contents.

Posted by jo...@apache.org.
Windows: Fixed os::getenv to handle empty string contents.

On Windows, there is normally no difference between setting an
environment variable to emptry string and outright deleting the
environment variable.  However, it is possible to differentiate the
two operations.  This changes the stout helper for `getenv` to
properly check if an environment variable exists or not.

This matters because some environment variables like
LIBPROCESS_METRICS_SNAPSHOT_ENDPOINT_RATE_LIMIT will operate differently
based on whether the variable is empty string or not.


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

Branch: refs/heads/master
Commit: 1ae308c2f1344d9e62e094ab11cc195c96eb5c04
Parents: 5eca61e
Author: Joseph Wu <jo...@apache.org>
Authored: Thu Aug 31 14:59:51 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Fri Sep 1 11:39:48 2017 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/stout/os/windows/getenv.hpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/1ae308c2/3rdparty/stout/include/stout/os/windows/getenv.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/os/windows/getenv.hpp b/3rdparty/stout/include/stout/os/windows/getenv.hpp
index 27a0e87..58012e0 100644
--- a/3rdparty/stout/include/stout/os/windows/getenv.hpp
+++ b/3rdparty/stout/include/stout/os/windows/getenv.hpp
@@ -38,7 +38,11 @@ inline Option<std::string> getenv(const std::string& key)
   // that.
   DWORD buffer_size = ::GetEnvironmentVariableW(wide_key.data(), nullptr, 0);
   if (buffer_size == 0) {
-    return None();
+    if (::GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
+      return None();
+    }
+
+    return "";
   }
 
   std::vector<wchar_t> environment;
@@ -49,9 +53,12 @@ inline Option<std::string> getenv(const std::string& key)
 
   if (value_size == 0) {
     // If `value_size == 0` here, that probably means the environment variable
-    // was deleted between when we checked and when we allocated the buffer. We
-    // report `None` to indicate the environment variable was not found.
-    return None();
+    // was deleted between when we checked and when we allocated the buffer.
+    if (::GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
+      return None();
+    }
+
+    return "";
   }
 
   return stringify(std::wstring(environment.data()));