Design Document for PP-913

 Interface : server hook event - “resv_end”

  • Visibility: Public

  • Change Control: Experimental

  • Details:

    • The hook created for this event will be invoked when there is an end to the reservation.

    • A new batch request PBS_BATCH_ResvOccurEnd shall be introduced which will be used to map the standing reservation occurrence end hook event.
    • This hook is created by pbsadmin and it will have read privileges to the server and the reservation objects.

    • The hook will run in foreground.

    • The reservation object with in the hook can be created by an interface pbs.event().resv exposed by the PBS event module.
    • The server object attributes can be accessed by the interface pbs.server() exposed by the PBS module. 
    • The reservation queue object attributes can be accessed by the interface pbs.event().resv.queue exposed by the PBS module.
    • The hook shall be executed before the jobs are deleted from the reservation queue.
    • The hook can accept or reject the reservation. Upon reject(), the hook will not interrupt the execution of the process invoking it and a log message - resv_end request rejected by <hook name> is added in the server logs.

    • On hitting the hook’s alarm, the hook gets rejected with a message - alarm call while running resv_end hook <hook name>, request rejected in the server logs.

                Usage:

           qmgr -c "create hook h1 event=resv_end"
           qmgr -c "import hook h1 application/x-python default <script path>"

                In the following case, If one tries to create a hook with a wrong event name:

           qmgr -c "s h h1 event=resvtest"
           qmgr obj=h1 svr=default: invalid argument (resvtest) to event.
          Should be one or more of: queuejob,modifyjob,resvsub,movejob,runjob,provision,periodic,resv_confirm,resv_end,execjob_begin,execjob_prologue,execjob_epilogue,execjob_preterm,
execjob_end,exechost_periodic,execjob_launch,exechost_startup or execjob_attach or "" for no event.
qmgr: hook error returned from server.