Commit 44017dc
authored
Single workflow pause API (#8605)
## What changed?
Note: This API is part of an experimental feature - "pause single
workflow"
- Added a new API (in Frontend & History) to pause workflow execution.
- Updated DescribeWorkflowExecution API to show the pause info.
- Added a dynamic config to control the access to this feature. The
PauseWorkflowExecution API fails if the config is not set.
- Added simple acceptance functional tests. These tests will evolve and
new ones added as the feature implementation progresses.
Followup PRs:
- Idempotency check in pause api.
- Validate input sizes.
- Intercept workflow task creation.
- Intercept and pause activities.
- Unpause API
## Why?
This API is needed to implement the "pause single workflow" feature.
## How did you test it?
- [x] built
- [x] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [x] added new functional test(s)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds a PauseWorkflowExecution API across frontend/history, wires
clients/GRPC/mocks, surfaces pause info in DescribeWorkflowExecution,
gates via new WorkflowPauseEnabled config, and adds functional tests.
>
> - **APIs/Protos**:
> - Add `PauseWorkflowExecutionRequest/Response` messages in
`api/historyservice/v1/request_response.proto` and generated Go files.
> - Extend `HistoryService` with `PauseWorkflowExecution` RPC (server,
client, grpc, mocks).
> - **Frontend**:
> - Implement `WorkflowHandler.PauseWorkflowExecution`, resolving
namespace, invoking history, and gating by `WorkflowPauseEnabled`.
> - Wire new config in `service.go`.
> - **History**:
> - Implement handler `PauseWorkflowExecution` in engine and new API
`service/history/api/pauseworkflow` to add paused event and handle
running-state checks.
> - Enhance `DescribeWorkflowExecution` to include `PauseInfo` in
`WorkflowExtendedInfo`.
> - **Clients**:
> - Add client methods (`client_gen`, `metric_client_gen`,
`retryable_client_gen`) and historyservice mocks.
> - **Config**:
> - Introduce `dynamicconfig.WorkflowPauseEnabled` (namespace-scoped)
and thread through frontend config.
> - **Telemetry/Logging**:
> - Add log tags for `PauseWorkflowExecution` and include RPC in
telemetry interceptor.
> - **Tests**:
> - Add functional tests `tests/pause_workflow_execution_test.go`
covering enabled/disabled scenarios.
> - **Dependencies**:
> - Bump `go.temporal.io/api` version.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
23e9f46. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 2cd597c commit 44017dc
File tree
24 files changed
+1219
-539
lines changed- api
- historyservicemock/v1
- historyservice/v1
- client/history
- common
- dynamicconfig
- rpc/interceptor
- logtags
- proto/internal/temporal/server/api/historyservice/v1
- service
- frontend
- history
- api
- describeworkflow
- pauseworkflow
- interfaces
- tests
24 files changed
+1219
-539
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1378 | 1378 | | |
1379 | 1379 | | |
1380 | 1380 | | |
1381 | | - | |
1382 | | - | |
| 1381 | + | |
| 1382 | + | |
1383 | 1383 | | |
1384 | 1384 | | |
1385 | 1385 | | |
| |||
1657 | 1657 | | |
1658 | 1658 | | |
1659 | 1659 | | |
1660 | | - | |
| 1660 | + | |
1661 | 1661 | | |
1662 | 1662 | | |
1663 | 1663 | | |
1664 | 1664 | | |
1665 | 1665 | | |
1666 | | - | |
| 1666 | + | |
1667 | 1667 | | |
1668 | 1668 | | |
1669 | 1669 | | |
| |||
2943 | 2943 | | |
2944 | 2944 | | |
2945 | 2945 | | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
2946 | 2952 | | |
Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments