JDK-6636094 : TEST BUG: jstatd processes launched in sun/tools/jstat/jstatdServerName.sh testare not always killed
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 6u10,7
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • OS: windows
  • CPU: generic
  • Submitted: 2007-11-30
  • Updated: 2014-04-07
  • Resolved: 2014-03-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b115Resolved
Related Reports
Duplicate :  
Description
For some reason jstatd processes launched in 
sun/tools/jstat/jstatdServerName.sh test are not always killed.

here is the output of "ps -ef | grep java" on vm-8450r-4.sfbay

> date 
Fri Nov 30 08:47:11 PST 2007

> ps -ef |grep java

gridadm  18720  10396  0   Nov 25 con  2d05 C:\local\common\jdk\baseline\windows-i586\bin\jstatd -J-Djava.security.policy=C:/local/common/testbase/jtreg/MISC_REGRESSION/test/sun/tools/jstatd/all.policy -p 2098

gridadm   1804  10396  0   Nov 25 con  2d05 C:\local\common\jdk\baseline\windows-i586\bin\jstatd -J-Djava.security.policy=C:/local/common/testbase/jtreg/MISC_REGRESSION/test/sun/tools/jstatd/all.policy -p 2099 -n SecondJstatdServer

According to jstatdServerName.sh the exit of the test is actually trapped:
    34  cleanup() {
    35    kill_proc ${JSTATD_1_PID}
    36    kill_proc ${JSTATD_2_PID}
    37  }
    38
    39  trap 'cleanup' 0 HUP INT QUIT TERM

So, it is not clear whether the problem is related to trap or there are some problems in
kill_proc() function (sun/jvmstat/testlibrary/utils.sh)

Comments
SUGGESTED FIX I think that if jstatd is started by some dedicated wrapper script which would unconditionally terminate jstatd process after (timeout) seconds then there will be no more stale jstatd's even if the main script receives SIGKILL.
01-12-2008

EVALUATION I know that jstatd will not be killed if this test times out (I can see that happening right now). I think that jtreg sends SIGKILL (kill -9) so the trap does not work.
01-12-2008