none
Task being cancelled by CTRL BREAK - why?

    Question

  • I am on 2012 R2 with latest QFE.

    I randomly see the tasks in my job 'finished' with a 'CTRL+BREAK' - why and when is this triggered by HPC? (my SOA dll is not doing this)

    I see the following in SOA Job Details -> View tasks -> Task details tab:

    HpcSoa Information: 10011 : HpcServiceHost entry point is called.
    HpcSoa Information: 11 : [Session:2923] OnAzure = False
    HpcSoa Information: 11 : [Session:2923] ServiceConfigFullPath = \\HEADNODE\HpcServiceRegistration\MyFile.config
    HpcSoa Information: 11 : [Session:2923] Sleep...

    forrtl: error (200): program aborting due to control-BREAK event

    Although it's a fortran program being called by my SOA dll, it's getting terminated due to the control-BREAK event - When/why is this being triggered ? (I have long running jobs)

    No error message in SOA Message Details other than 'Succeeded'

    I can handle that event via ServiceContext.OnExiting  event, but I'd like to know why HPC is triggering it to begin with.

    Monday, February 20, 2017 3:32 AM

All replies

  • Hi SRIRAM,

    HPC Node Manager Service stops a running task (including the service hosts) by sending a CTRL+BREAK signal to the application. Yes, you may handle the event via ServiceContext.OnExiting.

    Regards,

    Yutong Sun

    Tuesday, February 21, 2017 1:45 AM
  • My question is "why does the HPC Manager stop the task by CTRL + BREAK"  ? What triggers it to send a CTRL BREAK? 
    Tuesday, February 21, 2017 3:42 AM
  • Hi SRIRAM,

    The job scheduler by default uses CRTL_BREAK to stop running tasks, so that the application may respond to this event in a graceful period before the process is terminated. If the application failed to respond to this event, or the configurable task cancel grace period is set to 0, the process would be terminated immediately. There is also an alternative canceling event CTRL_C by specifying a job or cluster env CCP_TASK_NOTIFY with the value CTRL_C. To specify this cluster env, just use 'cluscfg setenvs CCP_TASK_NOTIFY=CTRL_C'.

    Regards,

    Yutong Sun

    Wednesday, February 22, 2017 7:11 AM
  • Hi SRIMAM,

      There are various reasons for the scheduler or broker to stop a ServiceHost for example: it SOA job is preempted by other jobs as the other one has higher priority; Or the user wants to cancel the job; Or there is some timeout triggered in the SOA system thus the policy decides to terminate the work on that node;

      All above these will result in scheduler cancelling the running task on the node (Which is the SOA service host). And in order to provide graceful exit (so that the application has change to release some external resource), we use CTRL+BREAK/CTRL+C event passing to the service code.

      You can have a check what reason might cause the service task being cancelled on the node.


    Qiufang Shi

    Wednesday, February 22, 2017 8:18 AM
  • Hi Qiufang

    Is there any way that I can send a WM_CLOSE instead of CTRL-C, in order to gracefully shut down a non-console application?

    Best regards,
    Thomas

    Monday, September 10, 2018 12:05 PM
  • Hi Thomas, currently this event is hardcoded in our system.

    Are you only looking for SOA application or just batch job? If batch job, we are considering to support sending customizable event to running task


    Qiufang Shi

    Tuesday, September 11, 2018 8:56 AM