...
- New functional tests to check the operation of the modifyresv hook.
- New hook event type:
HOOK_EVENT_MODIFYRESV
- process_hooks has been extended to run modifyresv hooks when run with the PBS_BATCH_ModifyResv event.
- In _pbs_python_event_set handling for the modifyresv hook event has been added. -- This also adds an internal resv_o variable similar to how job_o is used in the HOOK_EVENT_MODIFYJOB handler.
- A handler for HOOK_EVENT_MODIFYRESV has been added to _pbs_python_event_to_request to translate data written to the hook's event back into the initial modify request to allow the hook to modify appropraite parameters.
- A call to process_hooks() has been added to req_modifyReservation.
- The reservation event has writable attributes. These are the same attributes that are supported for the resvsub hook. Since resvsub can modify these parameters in a site-specified way, modifyresv should also be able to do so to preserve consistency in behavior between pbs_rsub and pbs_ralter's spite specified behavior.
- The changes in the modifyresv hook may be rejected by the server in subsequent processing even if the hook itself passes. A successful modification should also result in a reservation re-confirmation which should cause the resv_confirm hooks to be run.
- The changes to the reservation may be found in pbs.event().resv. The current state prior to changes being applied may be found in pbs.event().resv_o similar to how the objects for modifyjob hooks are populated.
Notes
- Existing reservation objects have been used (resvsub's data for modifyresv and resv_end for resv_begin and resv_confirm).
- Existing event parameters were used with the same read/write behavior as above.
- Due to reservation state being potentially updated internally to the scheduler separate from the server, resv_begin cannot safely modify a reservation once begun or it's queues or else we will definitely have a race condition when the advance reservation goes active. (see src/server/svr_jobfunc.c:Time4resv and src/scheduler/resource_resv.c:update_resresv_on_run)
- rq_resresvbegin is used to to allow process_hooks to run, as a pseudo-event since there is no PBS_BATCH event that actually triggers Time4resv where this hook is started from.
...