-
Bug
-
Resolution: Done
-
Major
-
EAP_EWP 5.2.0
-
None
-
Release Notes
-
-
-
Needs More Info
-
NEW
On Windows, when a process exits it's parent processes are not re-parented (like on Linux) and the parent process ID remains the same. This can be problematic if later another process is started and is assigned the same process id.
One situation that can occur:
1) One of Windows' core processes smss.exe with process id P spawns another core service csrss.exe. smss.exe then exits
2) Later on, jbosssvc.exe spawns service.bat and it is also assigned process id P, and it spawns java.exe to run JBoss with process id J
3) When asked to stop the service, jbosssvc.exe terminates process P and all processes with the parent process id of P
4) Since csrcc.exe also has P as it's parent process id (despite a different process spawning it) it is terminated and the OS fails with a blue screen of death.
The best was of terminating process groups on Windows is via Job Objects, however they are only supported on XP SP3, Vista, or later.
Aside from that, you can use heuristics by only killing processes which have:
1) the parent process id set to P
2) a process start time later than when we started service.bat, and/or
3) a specific executable name (if that is known). killing java.exe would stop the JBoss instance but it may not be the only child process.
The check in (2) can still have false positives, if service.bat exits and then process id P is re-used for yet another process.