[
https://issues.apache.org/jira/browse/HADOOP-12105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14612926#comment-14612926
]
Vinayakumar B commented on HADOOP-12105:
----------------------------------------
whether {{ps -p pid -o args}} portable?
bq. To add insult to injury, grep here forces another executable when using
bash regex would be significantly faster.
Yes. Agree. But considering this as stop/start script execution, which may not
be so frequent, IMO this is negligible.
bq. ... and even on those occasions when it does happen, the vast majority of
operations staff know how to handle it because we certainly aren't the only
ones that suffer from this issue.
Yes, staff would know to what to do, once they come to know something went
wrong. Before that, we can do something if we can, just to save their time.
> Avoid returning 0 , while fetching the status of a process ,which is not
> running.
> ---------------------------------------------------------------------------------
>
> Key: HADOOP-12105
> URL: https://issues.apache.org/jira/browse/HADOOP-12105
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: J.Andreina
> Assignee: J.Andreina
>
> If the process(Namenode) is crashed there will be stale pid file .
> Any other JVM process might get allocated with the same pid as that of the
> content of stale pid file.
> As per current implementation for fetching the status :
> we check if any process is running with pid (fetched from
> corresponding process pid file) then returns 0.
> {code}
> if ps -p "${pid}" > /dev/null 2>&1; then
> return 0
> fi
> {code}
> *So while fetching the status of namenode return code will be 0 , even if the
> namenode process is not running (because some other process is assigned with
> same pid ).*
> Can we check status of process as below
> {code}
> if ps -fp pid | grep process_classname > /dev/null 2>&1; then
> return 0
> fi
> {code}
> Please provide your feedback.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)