This is an automated email from the ASF dual-hosted git repository.

vinayakumarb pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new e2b91b2  YARN-8498. Yarn NodeManager OOM Listener Fails Compilation on 
Ubuntu 18.04. Contributed by Ayush Saxena.
e2b91b2 is described below

commit e2b91b2ccb1eb43ecc4786af974635ba9744befc
Author: Vinayakumar B <vinayakum...@apache.org>
AuthorDate: Thu Feb 7 13:02:35 2019 +0530

    YARN-8498. Yarn NodeManager OOM Listener Fails Compilation on Ubuntu 18.04. 
Contributed by Ayush Saxena.
---
 .../src/main/native/oom-listener/impl/oom_listener_main.c  |  4 +++-
 .../native/oom-listener/test/oom_listener_test_main.cc     | 14 +++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/impl/oom_listener_main.c
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/impl/oom_listener_main.c
index eb7fc3e..2f4bac8 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/impl/oom_listener_main.c
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/impl/oom_listener_main.c
@@ -25,6 +25,8 @@
 
 #include "oom_listener.h"
 
+extern inline void cleanup(_oom_listener_descriptors *descriptors);
+
 void print_usage(void) {
   fprintf(stderr, "oom-listener");
   fprintf(stderr, "Listen to OOM events in a cgroup");
@@ -101,4 +103,4 @@ int main() {
   return 1;
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/test/oom_listener_test_main.cc
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/test/oom_listener_test_main.cc
index 421c21e..b79d501 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/test/oom_listener_test_main.cc
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/test/oom_listener_test_main.cc
@@ -159,7 +159,7 @@ TEST_F(OOMListenerTest, test_oom) {
   const int simulate_cgroups =
       mock_oom_event_as_user != -1;
 
-  __pid_t mem_hog_pid = fork();
+  pid_t mem_hog_pid = fork();
   if (!mem_hog_pid) {
     // Child process to consume too much memory
     if (simulate_cgroups) {
@@ -171,7 +171,7 @@ TEST_F(OOMListenerTest, test_oom) {
       // Wait until we are added to the cgroup
       // so that it is accounted for our mem
       // usage
-      __pid_t cgroupPid;
+      pid_t cgroupPid;
       do {
         std::ifstream tasks;
         tasks.open(tasks_file.c_str(), tasks.in);
@@ -210,7 +210,7 @@ TEST_F(OOMListenerTest, test_oom) {
     // There is no race condition with the process
     // running out of memory. If oom is 1 at startup
     // oom_listener will send an initial notification
-    __pid_t listener = fork();
+    pid_t listener = fork();
     if (listener == 0) {
       // child listener forwarding cgroup events
       _oom_listener_descriptors descriptors = {
@@ -253,8 +253,8 @@ TEST_F(OOMListenerTest, test_oom) {
       ASSERT_EQ(0, kill(mem_hog_pid, SIGKILL));
 
       // Verify that process was killed
-      __WAIT_STATUS mem_hog_status = {};
-      __pid_t exited0 = wait(mem_hog_status);
+      int* mem_hog_status = {};
+      pid_t exited0 = wait(mem_hog_status);
       ASSERT_EQ(mem_hog_pid, exited0)
         << "Wrong process exited";
       ASSERT_EQ(NULL, mem_hog_status)
@@ -272,8 +272,8 @@ TEST_F(OOMListenerTest, test_oom) {
                 << "Could not delete cgroup " << GetCGroup();
 
       // Check that oom_listener exited on the deletion of the cgroup
-      __WAIT_STATUS oom_listener_status = {};
-      __pid_t exited1 = wait(oom_listener_status);
+      int* oom_listener_status = {};
+      pid_t exited1 = wait(oom_listener_status);
       ASSERT_EQ(listener, exited1)
         << "Wrong process exited";
       ASSERT_EQ(NULL, oom_listener_status)


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to