locked
IScheduler.FinishJob RRS feed

  • Question

  • Any documentation on IScheduler.FinishJob available? Google (or bing) did not give me any results. I have a SOA job (created using a durable session from a windows forms client) that is deployed to the cluster.

    FinishJob will be called from the SOA dll itself marking the 'finish' of job. I would like to set the graceful flag to true so that the last node, when it calls the FinishJob() will not interrupt/stop the other run(s) of the same job running on other workstation node(s)

    (if i do not do this, the job will be in "running" state forever - even after the actual work is done and i do not want a client to connect to this to close the session or finish the job). 

    My HPC SOA dll processes a bunch of rows and each workstation updates the row in the database once it picks up. the node that processes the last row would call finishjob() on ischeduler, but a node may still be processing a row before the last row, hence this question

    Possible?

    Thanks!



    • Edited by SRIRAM R Thursday, June 23, 2016 9:54 PM
    Thursday, June 23, 2016 9:48 PM

Answers

  • When using Scheduler API to submit and run non-SOA jobs, the ISchedulerJob.Finish can be called to finish the job. When using SOA Session API, usually it is not necessary to call Scheduler API directly to interact with the service job. SOA Session API which is a higher level API than Scheduler API should be complete and fit for the SOA service scenarios.

    • Marked as answer by SRIRAM R Friday, June 24, 2016 11:27 AM
    Friday, June 24, 2016 6:28 AM

All replies

  • Hi SRIRAM R,

    ISchedulerJob has a Finish method (refer here) to finish the job. However it is not recommended to finish a SOA service job by calling this method. If a SOA session completes with all work done, just call SessionBase.Close method on the Session/DurableSession object, it will clean up the session resources and finish the service job.

    As for your scenario, if no client knows whether all session work is done and closes the session, you may utilize the SessionIdleTimeout to let the session close itself when the session is idle for that time period. The SessionIdleTimeout can be specified in the service registration file at the service level, or in the Session API: SessionStartInfo.BrokerSettings.SessionIdleTimeout at the session level.

    Just note, if using SessionIdleTimeout, it may reduce the cluster utilization a bit, since when the session is idling, the service job would keep running for that period. So I would recommend to let a master client know that alll work is done (e.g. all responses are received on all clients) and then call SessionBase.Close to close the SOA session and finish the service job.

    Regards,

    Yutong Sun

    Friday, June 24, 2016 3:54 AM
  • Thanks. Guess I will attach to the durable session from the SOA dll itself and call Close() on the session. I'd prefer not using the sessionidletimeout for the very reasons you mention above.

    For my SOA dll logic, the client need not be "aware" of the job completion - one of the workstation nodes should be able to know the completion and  thus session Close() can be called by one of them.

    WHile on the subject, if IScheduler.Finish is *not* recommended, what good does it do and where is it recommended?

    Thanks!

    Friday, June 24, 2016 4:02 AM
  • When using Scheduler API to submit and run non-SOA jobs, the ISchedulerJob.Finish can be called to finish the job. When using SOA Session API, usually it is not necessary to call Scheduler API directly to interact with the service job. SOA Session API which is a higher level API than Scheduler API should be complete and fit for the SOA service scenarios.

    • Marked as answer by SRIRAM R Friday, June 24, 2016 11:27 AM
    Friday, June 24, 2016 6:28 AM