Design Document for PP-1289

 Interface : server hook event - “resv_confirm”

  • Visibility: Public

  • Change Control: Experimental

  • Details:

    • The hook created for this event will be invoked when there is a request for reservation confirmation which occurs after submitting a reservation, a confirmed reservation is altered or when a running reservation is altered.

    • 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 with the PBS server.

    • 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 can accept or reject the reservation. Upon accept(), the reservation request gets confirmed status from the PBS server. Upon reject(), the following are the usecases:

      • If the reservation that was submitted has not yet started, the reservation object will be purged from the server.

      • If there is a confirmed reservation which has not yet started and and an alter requested on it, the reservation will continue to stay with it’s original attributes.

      • If there is a running reservation and an alter is requested on that, the reservation will continue to run with it’s original attributes.

                            A message - resv_confirm request rejected by <hook name> is added into the server logs.

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

                Usage:             

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

               In the following case, If someone 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,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