[
https://issues.apache.org/jira/browse/YARN-8498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16738362#comment-16738362
]
Jason Lowe commented on YARN-8498:
----------------------------------
Just coming up to speed on this, so apologies if I'm missing something here.
To me the main issue is using private types when the code has no good reason to
do so. The [manpage for wait(2)|
http://man7.org/linux/man-pages/man2/wait.2.html] shows it returning a
{{pid_t}}, not a {{\_\_pid_t}}, so I don't understand why the code insists on
using the private {{\_\_pid_t}} type. That's going to cause problems if a
system ever decides to _not_ typedef {{pid_t}} to {{\_\_pid_t}}, and systems
are completely free to make that choice in the future. Same goes for
{{\_\_WAIT_STATUS}}. This is a private type that should not be used in user
code directly. The manpage shows that {{wait}} takes an {{int*}} argument, not
a {{\_\_WAIT_STATUS}}. This smells like someone coded directly against the
header files rather than reading the manpages, and the risk of the former is
using private, system-specific types that may not compile on other distros.
So I think fixing this for all Linux distros going forward is as simple as
changing {{\_\_pid_t}} to {{pid_t}} and {{\_\_WAIT_STATUS}} to {{int *}}.
> Yarn NodeManager OOM Listener Fails Compilation on Ubuntu 18.04
> ---------------------------------------------------------------
>
> Key: YARN-8498
> URL: https://issues.apache.org/jira/browse/YARN-8498
> Project: Hadoop YARN
> Issue Type: Bug
> Reporter: Jack Bearden
> Assignee: Ayush Saxena
> Priority: Blocker
> Attachments: YARN-8948-01.patch
>
>
> While building this project, I ran into a few compilation errors here. The
> first one was in this file:
> hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/impl/oom_listener_main.c
> At the very end, during the compilation of the OOM test, it fails again:
>
> hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/test/oom_listener_test_main.cc
> hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/test/oom_listener_test_main.cc:256:7:
> error: ‘__WAIT_STATUS’ was not declared in this scope
> __WAIT_STATUS mem_hog_status = {};
> hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/test/oom_listener_test_main.cc:257:30:
> error: ‘mem_hog_status’ was not declared in this scope
> __pid_t exited0 = wait(mem_hog_status);
> hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/test/oom_listener_test_main.cc:275:21:
> error: expected ‘;’ before ‘oom_listener_status’
> __WAIT_STATUS oom_listener_status = {};
> hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/oom-listener/test/oom_listener_test_main.cc:276:30:
> error: ‘oom_listener_status’ was not declared in this scope
> __pid_t exited1 = wait(oom_listener_status);
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]