For successful tasks and failed tasks, as JvmRunner.kill() is not getting called, their subprocesses are not killed. Even if we call kill for these tasks, the cleanup of pidFile might be done already and we can't get pid of taskJvm.
So I am planning to export pid of task in some env variable and then sending pid of taskJvm from Child(task) to parent(TT) using umbilical protocol ---- changing the methodCall umbilical.getTask(JVMId) to umbilical.getTask(JVMId, pid) in Child.java and getTask() in TT would set pid in jvmIdToPidMap, which will be used by JvmRunner.kill(). And JvmRunner.runChild() will call kill() in the finally block, if it was not called earlier for this jvm.
This approach would avoid the pidFiles altogether.