none
Cancelling a job which spawns multiple processes that are not necessarily child processes RRS feed

  • Question

  • Hi,

    I am submitting a job to execute a ".bat" file. From the bat file I spawn a java process, which further spawns some processes via JNI and COM API calls. So as a result of this, the following processes are created:

    1) cmd.exe
    2) java.exe
    3) other processes as a result of JNI/COM API calles

    Now when I cancel the job, the cmd.exe and java.exe processes get killed, but the processes that were spawned as a result of JNI calls keep hanging in there indefinitely. Is there any way of handling this problem in the Windows cluster? Is there a way to tell the cluster manager to cancel a job and kill all the processes related to the process, even if they are not child processes? What is the mechanism used on the cluster nodes to cancel a job?

    Thanks,
    Prashant

    Monday, November 30, 2009 6:13 PM

Answers

  • This customization feature will be in V3, but not V2.

    Friday, December 4, 2009 7:04 PM
    Moderator

All replies

  • Hi Prashant,

    Once a task gets canceled, the Windows Job spawned by the task will be stopped. All processes within this Windows Job will be killed. A process’s sub-processes always belongs to the same Windows Job (unless otherwise specified when creating the sub-process), hence will be killed as well. That’s why you saw the cmd and java were killed. However, the JNI and COM program were started by another service. So they were running out of the current Windows Job. In this case, they won’t be killed.
    COM runs as a separate service and it is spawning up these extra processes. It is up-to the server to clean these up after the user process exits.

    Thanks,
    Rae

     

    Thursday, December 3, 2009 7:24 PM
    Moderator
  • Thanks for the response Rae!

    Is there any option to tell the cluster manager, that instead of killing a job forcefully, call another program (which a user specifies) which manages clean exit of a task?

    Regards,
    Prashant
    Thursday, December 3, 2009 9:08 PM
  • This customization feature will be in V3, but not V2.

    Friday, December 4, 2009 7:04 PM
    Moderator