locked
unable to create dependent job RRS feed

  • Question

  • I am using 2012 R2 Pack with latest QFE installed.

    Trying to create a 'child job' to do some "cleanup" after the main job is complete. But the child job does not get created (no error/exception either). What could i be missing. Here is the code:

    int intSessionId;
    
    using (DurableSession session = DurableSession.CreateSession(info))
    {
    intSessionId = session.Id;
    
    using (BrokerClient<IComputeWorker> client = new BrokerClient<IComputeWorker>(session))
    {
    ..
    ..
    
    }
    }
    
    //main job succesfully submitted.
    //Now,create a child job
    
    IScheduler scheduler2 = new Scheduler();
                scheduler2.Connect(ConfigurationManager.AppSettings["HPCHeadNode"]);
                ISchedulerJob childjob = scheduler2.CreateJob();
                childjob.Name = "Cleanup for Job Id:" + intSessionID.ToString();
                childjob.SetJobTemplate("MyJobTemplate");
                childjob.Project = "Project Name" + ProjectID.ToString();
                IIntCollection parentjobcollection = scheduler2.CreateIntCollection();
                parentjobcollection.Add(intSessionID);
                childjob.ParentJobIds = parentjobcollection;
                ISchedulerTask task = childjob.CreateTask();
                task.CommandLine = @"\\uncpath\HPCJobCleanup.exe " + intSessionID.ToString();
                childjob.AddTask(task);
                scheduler2.SubmitJob(childjob, Environment.UserDomainName + @"\" + Environment.UserName,strPassword);
    

    Friday, October 14, 2016 1:26 PM

Answers

  • I was looking under 'SOA jobs' in Job Management in Cluster manager. Since the child job is a regular, non-SOA job, it was not showing up there, and it was under 'all jobs'


    • Marked as answer by SRIRAM R Wednesday, October 19, 2016 10:03 AM
    Wednesday, October 19, 2016 10:02 AM

All replies

  • Hi SRIRAM,

    I did not simply repro this. The child job APIs should work fine. Could you double check the head node name to see if it points to the same cluster? And also check if the job template can be used to submit the child job.

    Regards,

    Yutong Sun

    Tuesday, October 18, 2016 5:35 AM
  • I was looking under 'SOA jobs' in Job Management in Cluster manager. Since the child job is a regular, non-SOA job, it was not showing up there, and it was under 'all jobs'


    • Marked as answer by SRIRAM R Wednesday, October 19, 2016 10:03 AM
    Wednesday, October 19, 2016 10:02 AM