Skip to content

feat(hook): support deferred delivery results - #1084

Closed
mnoah1 wants to merge 1 commit into
mainfrom
mnoah1/hook-deferred-delivery
Closed

mnoah1 wants to merge 1 commit into
mainfrom
mnoah1/hook-deferred-delivery

Conversation

@mnoah1

@mnoah1 mnoah1 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Let hooks return a result with an optional Unix millisecond retry deadline so integrations can honor cooldowns without keeping a worker busy.
  • Reuse Delivery.Hold after concurrent dispatch, choosing the latest requested deadline while preserving normal handling for every actual failure.
  • Update the no-op hook, generated mock, contract documentation, and dispatcher regression coverage.

Test Plan

  • Bazel hook and no-op suites cover completed, deferred, expired, concurrent, and mixed failure outcomes.
  • Stovepipe, SubmitQueue orchestrator, and Runway reference servers build with the new signature.
  • make lint, make check-tidy, and make check-gazelle pass. Run ./tool/bazel test //platform/hook:go_default_test //platform/extension/hook/noop:go_default_test to reproduce the focused tests.

Revert Plan

Revert this PR and migrate callers back to the previous Handle signature together.

API Changes

Hook.Handle now returns (hook.Result, error). Consumers return a zero result when done; a positive RetryNotBeforeMs requests deferred redelivery. Any hook error takes precedence over all deferral results.

Issue Links

None — public API enhancement without a public tracking issue.

Summary:
- Let hooks return a result with an optional Unix millisecond retry deadline so integrations can honor cooldowns without keeping a worker busy.
- Reuse Delivery.Hold after concurrent dispatch, choosing the latest requested deadline while preserving normal handling for every actual failure.
- Update the no-op hook, generated mock, contract documentation, and dispatcher regression coverage.

Test Plan:
- Bazel hook and no-op suites cover completed, deferred, expired, concurrent, and mixed failure outcomes.
- Stovepipe, SubmitQueue orchestrator, and Runway reference servers build with the new signature.
- make lint, make check-tidy, and make check-gazelle pass. Run ./tool/bazel test //platform/hook:go_default_test //platform/extension/hook/noop:go_default_test to reproduce the focused tests.

API Changes:
Hook.Handle now returns (hook.Result, error). Consumers return a zero result when done; a positive RetryNotBeforeMs requests deferred redelivery. Any hook error takes precedence over all deferral results.

Revert Plan:
Revert this PR and migrate callers back to the previous Handle signature together.
@mnoah1
mnoah1 marked this pull request as ready for review November 13, 2026 21:25
@mnoah1
mnoah1 requested review from a team, behinddwalls and sbalabanov as code owners November 13, 2026 21:25
@mnoah1
mnoah1 marked this pull request as draft November 13, 2026 21:28
@mnoah1 mnoah1 closed this Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant