temporal
temporal copied to clipboard
Fix schedule_action_delay metric for buffered actions
What changed?
- Calculate "delay" for buffered actions from previous action close.
- Update a few logs.
Why?
If an action is held up by waiting for a previous action to finish (e.g. BufferOne, BufferAll, CancelOther overlap policies), it's not fair to count the waiting time as the "delay" for that action.
How did you test it?
Tested locally by building up a backlog and checking that the metric didn't increase (and did before this change). Also tested upgrade and downgrade.
Potential risks
This is touching workflow code, but is compatible because:
- If it sees nil for the close time or desired time, that's fine, it just falls back to actual time.
- All the behavior changes are in logs and metrics only.