Design document for node state change hook event


A design proposal for adding a node state change hook event has just been created. The purpose is to enable admins to deploy site-specific scripts that execute when a node changes state.

This is a WIP and feedback would be appreciated.

Thank you

Hey @monkeystate,
Thanks for taking up this endeavour, it will be a great addition to our hook infrastructure.

I have a few suggestions.

  1. We usually expose things on the event, not off of pbs itself. How about you expose the old/new node states off of pbs.event() (pbs.event().old_state/pbs.event.new_state)
  2. This hook could be a lot more beneficial if we expose the whole node as well. This way you can do more than just account for time in different states. You can have pbs.event().node, just like other hooks hav pbs.event().job. If you do this, you won’t have to keep track of the amount of time since the last node state. This is already an attribute on the node itself (last_state_change_time)
  3. I know the design is WIP, but maybe you could add a section on exactly what is changing for hook writers, and how they will use the hook. The internals you have are also useful, but not so much for doc team. Also include what happens when you accept/reject this hook. My guess is nothing special other than a log message, but it will be good to explicitly say.


Hello @bhroam,

Thanks so much for your suggestions! We’ll be following up shortly.