Anonymous | Login | Signup for a new account | 12-09-2024 15:07 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0000061 | [Resin] | minor | always | 03-30-05 00:00 | 01-25-06 11:28 | ||||
Reporter | sam | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | |||||||
Summary | 0000061: wrapper.pl kill enhancement | ||||||||
Description |
RSN-52 (rep by B Bernstein) We've recently found a small problem with the "stop" part of wrapper.pl, and I'd like to see if there are any suggestions on how to deal with it. We found that a third party component that we were using in a servlet was freezing up our webapp. Of course we're working on getting that corrected, but in the meantime, it became impossible to kill the java resin process while it was in that hung state. We use the Perl wrapper to launch Resin, so when we sent the "stop" command, it ran it's normal code which kills the java child process. In our case, it was timing out after 60 seconds, and then we had the orphan process sitting around after that. We then needed to manually "kill -9" that orphan. What I'd really like to have it do as a fallback (if kill fails) is to then call: kill(-9, $child) Alternatively, have the wrapper return an error if the kill failed, so that our script can do something about it. Our script that calls wrapper to stop or restart the process does it's own checking and waits until the procid goes away, but it only knows about the wrapper's procid, so when the wrapper fails to kill it's child, it just exits and never lets any external processes know that it failed. So, our calling script thinks it was successful. We're using resin 2.1.x, but I see that the same code is in 3.0.x versions of the perl wrapper. Here is something like what I have in mind for that code excerpt (not tested): if ($child > 0) { $def_kill_time = $kill_time; # let it die gracefully in 60 seconds while ($kill_time-- > 0 and kill(0, $child)) { sleep(1); } if ($kill_time <= 0) { print("Resin proc $child didn't die, trying kill -$child"); # timed-out, try again with -$child $kill_time = $def_kill_time; while ($kill_time-- > 0 and kill(-$child)) { sleep(1); } } if ($kill_time <= 0) { print("Resin proc $child STILL didn't die, trying kill -9 $child"); kill(-9, $child); } } |
||||||||
Additional Information | Unix | ||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed. 29 unique queries executed. |