Comments (2)
Thanks for your report, Walter!
The code is correct as written. The kill
command in bash
returns 0 on success, yes, but success in this case doesn't mean the process went away. It simply means that the signal was successfully delivered to the process(es) specified. From the bash(1)
man page:
kill returns true if at least one signal was successfully sent, or false if an error occurs or an invalid option is encountered.
In particular, "successfully sent" means that there was a process with the specified PID which was able to receive the signal. A non-zero return value, for our purposes, means that the specified process is no longer there to receive the signal -- i.e., it's already been successfully killed.
NHC uses the || return 0
you noted in the code to handle the case where either the process went away on its own, or NHC's previous attempt(s) to terminate it were successful, so it doesn't need to continue trying to kill
(i.e., signal) it. If the invocation of kill
succeeds, then the process is still there, so NHC might not have successfully gotten it to die yet and must therefore keep trying. Just because kill
returns success doesn't mean the process actually died, though. It only means that the signal was delivered.
Make sense?
from nhc.
Yes, so true.
Thanks!
On Wed, Mar 30, 2016 at 8:50 PM, Michael Jennings [email protected]
wrote:
Thanks for your report, Walter!
The code is correct as written. The kill command in bash returns 0 on
success, yes, but success in this case doesn't mean the process went away.
It simply means that the signal was successfully delivered to the
process(es) specified. From the bash(1) man page:kill returns true if at least one signal was successfully sent, or false if an error occurs or an invalid option is encountered.
In particular, "successfully sent" means that there was a process with the
specified PID which was able to receive the signal. A non-zero return
value, for our purposes, means that the specified process is no longer
there to receive the signal -- i.e., it's already been successfully killed.NHC uses the || return 0 you noted in the code to handle the case where
either the process went away on its own, or NHC's previous attempt(s) to
terminate it were successful, so it doesn't need to continue trying to
kill (i.e., signal) it. If the invocation of kill succeeds, then the
process is still there, so NHC might not have successfully gotten it to die
yet and must therefore keep trying. Just because kill returns success
doesn't mean the process actually died, though. It only means that the
signal was delivered.Make sense?
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#13 (comment)
If a woodchuck could chuck wood, and a woodchuck would chuck wood,
how much wood would a woodchuck chuck?
from nhc.
Related Issues (20)
- bug in nhc_job_find_users() leading to misjudgment of illegal process
- `nhc_common_parse_size` doesn't support decimal values HOT 1
- "Fix" Permissions in RPM HOT 1
- Default output to stdout/stderr when the -e option is used
- Display check numbers in verbose mode
- Add option to output results in JSON
- NHC Helpers vs. Unknown Slurm States HOT 2
- Improve Script Safety with Checksum/Signature Verification?
- Version Flag HOT 1
- Improve Hostname Customization
- Pattern error message HOT 2
- Manually drained node got resumed after watchdog timer was unable to terminate hung NHC process HOT 3
- External Match doesn't work for me HOT 3
- Support for OpenPBS HOT 5
- Using something like an 'include' directive? or better with templates HOT 2
- Question: Custom Check, How to exit without any changes, i.e. leave node in current state? HOT 3
- Question for faster execution: Seeing cpu_info add 10 secs to execution HOT 4
- check_cmd_dmesg() Reason Strings Cause Problems
- Helper scripts are not called when the node fails the health check with Slurm HOT 13
- scripts/lbnl_hw.nhc: nhc_hw_gather_data is slow at parsing /proc/cpuinfo HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nhc.