@temporalio/core-bridge 1.7.1 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +21 -0
- package/lib/index.d.ts +10 -10
- package/package.json +4 -4
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/sdk-core/.buildkite/pipeline.yml +1 -1
- package/sdk-core/.cargo/config.toml +2 -0
- package/sdk-core/CODEOWNERS +1 -1
- package/sdk-core/client/src/raw.rs +15 -6
- package/sdk-core/core/Cargo.toml +1 -0
- package/sdk-core/core/src/core_tests/activity_tasks.rs +13 -5
- package/sdk-core/core/src/core_tests/workflow_tasks.rs +45 -77
- package/sdk-core/core/src/internal_flags.rs +132 -46
- package/sdk-core/core/src/worker/activities/activity_task_poller_stream.rs +10 -7
- package/sdk-core/core/src/worker/activities.rs +152 -142
- package/sdk-core/core/src/worker/client.rs +12 -8
- package/sdk-core/core/src/worker/mod.rs +7 -5
- package/sdk-core/core/src/worker/workflow/history_update.rs +733 -33
- package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +1 -1
- package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +4 -1
- package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +5 -2
- package/sdk-core/core/src/worker/workflow/managed_run/managed_wf_test.rs +1 -1
- package/sdk-core/core/src/worker/workflow/managed_run.rs +0 -4
- package/sdk-core/protos/api_upstream/.github/workflows/publish-docs.yml +23 -0
- package/sdk-core/protos/api_upstream/Makefile +1 -1
- package/sdk-core/protos/api_upstream/buf.yaml +5 -0
- package/sdk-core/protos/api_upstream/temporal/api/common/v1/message.proto +17 -0
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +2 -0
- package/sdk-core/protos/api_upstream/temporal/api/history/v1/message.proto +6 -3
- package/sdk-core/protos/api_upstream/temporal/api/protocol/v1/message.proto +1 -1
- package/sdk-core/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +12 -22
- package/sdk-core/protos/api_upstream/temporal/api/update/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/workflow/v1/message.proto +2 -0
- package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +145 -48
- package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +19 -8
- package/sdk-core/sdk/src/workflow_context/options.rs +1 -1
- package/sdk-core/sdk/src/workflow_context.rs +9 -1
- package/sdk-core/test-utils/src/lib.rs +29 -7
- package/sdk-core/tests/integ_tests/activity_functions.rs +5 -0
- package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +2 -4
- package/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +0 -1
- package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +5 -7
- package/sdk-core/tests/integ_tests/workflow_tests.rs +3 -7
- package/sdk-core/tests/main.rs +1 -0
- package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
- package/releases/x86_64-apple-darwin/index.node +0 -0
- package/releases/x86_64-pc-windows-msvc/index.node +0 -0
- package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
|
@@ -531,7 +531,7 @@ impl TryFrom<HistEventData> for ChildWorkflowMachineEvents {
|
|
|
531
531
|
Self::ChildWorkflowExecutionCancelled
|
|
532
532
|
}
|
|
533
533
|
_ => {
|
|
534
|
-
return Err(WFMachinesError::
|
|
534
|
+
return Err(WFMachinesError::Nondeterminism(format!(
|
|
535
535
|
"Child workflow machine does not handle this event: {e:?}"
|
|
536
536
|
)))
|
|
537
537
|
}
|
|
@@ -234,7 +234,10 @@ impl WFMachinesAdapter for SignalExternalMachine {
|
|
|
234
234
|
SignalExternalWorkflowExecutionFailedCause::Unspecified => "unknown",
|
|
235
235
|
SignalExternalWorkflowExecutionFailedCause::ExternalWorkflowExecutionNotFound
|
|
236
236
|
| SignalExternalWorkflowExecutionFailedCause::NamespaceNotFound =>
|
|
237
|
-
"it was not found"
|
|
237
|
+
"it was not found",
|
|
238
|
+
SignalExternalWorkflowExecutionFailedCause::SignalCountLimitExceeded => {
|
|
239
|
+
"The per-workflow signal limit was exceeded"
|
|
240
|
+
}
|
|
238
241
|
};
|
|
239
242
|
vec![ResolveSignalExternalWorkflow {
|
|
240
243
|
seq: self.shared_state.seq,
|
|
@@ -331,6 +331,11 @@ impl WorkflowMachines {
|
|
|
331
331
|
/// sent off to the server. They are not removed from the internal queue, that happens when
|
|
332
332
|
/// corresponding history events from the server are being handled.
|
|
333
333
|
pub(crate) fn get_commands(&self) -> Vec<ProtoCommand> {
|
|
334
|
+
// Since we're about to write a WFT, record any internal flags we know about which aren't
|
|
335
|
+
// already recorded.
|
|
336
|
+
(*self.observed_internal_flags)
|
|
337
|
+
.borrow_mut()
|
|
338
|
+
.write_all_known();
|
|
334
339
|
self.commands
|
|
335
340
|
.iter()
|
|
336
341
|
.filter_map(|c| {
|
|
@@ -363,8 +368,6 @@ impl WorkflowMachines {
|
|
|
363
368
|
available_internal_flags: (*self.observed_internal_flags)
|
|
364
369
|
.borrow()
|
|
365
370
|
.all_lang()
|
|
366
|
-
.iter()
|
|
367
|
-
.copied()
|
|
368
371
|
.collect(),
|
|
369
372
|
}
|
|
370
373
|
}
|
|
@@ -936,7 +936,6 @@ impl ManagedRun {
|
|
|
936
936
|
}
|
|
937
937
|
|
|
938
938
|
fn insert_outstanding_activation(&mut self, act: &ActivationOrAuto) {
|
|
939
|
-
warn!("Inserting {:?}", act);
|
|
940
939
|
let act_type = match &act {
|
|
941
940
|
ActivationOrAuto::LangActivation(act) | ActivationOrAuto::ReadyForQueries(act) => {
|
|
942
941
|
if act.is_legacy_query() {
|
|
@@ -1032,9 +1031,6 @@ impl ManagedRun {
|
|
|
1032
1031
|
new_local_acts: Vec<LocalActRequest>,
|
|
1033
1032
|
) -> Result<(), WFMachinesError> {
|
|
1034
1033
|
let immediate_resolutions = self.local_activity_request_sink.sink_reqs(new_local_acts);
|
|
1035
|
-
if !immediate_resolutions.is_empty() {
|
|
1036
|
-
warn!("Immediate res: {:?}", &immediate_resolutions);
|
|
1037
|
-
}
|
|
1038
1034
|
for resolution in immediate_resolutions {
|
|
1039
1035
|
self.wfm
|
|
1040
1036
|
.notify_of_local_result(LocalResolution::LocalActivity(resolution))?;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Publish docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
10
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repo
|
|
18
|
+
uses: actions/checkout@v3
|
|
19
|
+
- name: Generate docs
|
|
20
|
+
run: |
|
|
21
|
+
docker run -v $(pwd)/docs:/out -v $(pwd)/:/protos pseudomuto/protoc-gen-doc --doc_opt=html,index.html $(find temporal/api -type f -name "*.proto")
|
|
22
|
+
- name: Deploy
|
|
23
|
+
run: npx vercel deploy docs/ --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
@@ -29,7 +29,7 @@ $(PROTO_OUT):
|
|
|
29
29
|
mkdir $(PROTO_OUT)
|
|
30
30
|
|
|
31
31
|
##### Compile proto files for go #####
|
|
32
|
-
grpc: buf-lint api-linter
|
|
32
|
+
grpc: buf-lint api-linter gogo-grpc fix-path
|
|
33
33
|
|
|
34
34
|
go-grpc: clean $(PROTO_OUT)
|
|
35
35
|
printf $(COLOR) "Compile for go-gRPC..."
|
|
@@ -121,3 +121,20 @@ message MeteringMetadata {
|
|
|
121
121
|
// aip.dev/not-precedent: Negative values make no sense to represent. --)
|
|
122
122
|
uint32 nonfirst_local_activity_execution_attempts = 13;
|
|
123
123
|
}
|
|
124
|
+
|
|
125
|
+
// Identifies the version(s) of a worker that processed a task
|
|
126
|
+
message WorkerVersionStamp {
|
|
127
|
+
// An opaque whole-worker identifier
|
|
128
|
+
string build_id = 1;
|
|
129
|
+
// Set if the worker used a dynamically loadable bundle to process
|
|
130
|
+
// the task. The bundle could be a WASM blob, JS bundle, etc.
|
|
131
|
+
string bundle_id = 2;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Identifies the version(s) that a worker is compatible with when polling or identifying itself
|
|
135
|
+
message WorkerVersionCapabilities {
|
|
136
|
+
// An opaque whole-worker identifier
|
|
137
|
+
string build_id = 1;
|
|
138
|
+
|
|
139
|
+
// Later, may include info like "I can process WASM and/or JS bundles"
|
|
140
|
+
}
|
|
@@ -108,6 +108,8 @@ enum SignalExternalWorkflowExecutionFailedCause {
|
|
|
108
108
|
SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNSPECIFIED = 0;
|
|
109
109
|
SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_EXTERNAL_WORKFLOW_EXECUTION_NOT_FOUND = 1;
|
|
110
110
|
SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_NAMESPACE_NOT_FOUND = 2;
|
|
111
|
+
// Signal count limit is per workflow and controlled by server dynamic config "history.maximumSignalsPerExecution"
|
|
112
|
+
SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_SIGNAL_COUNT_LIMIT_EXCEEDED = 3;
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
enum ResourceExhaustedCause {
|
|
@@ -193,9 +193,10 @@ message WorkflowTaskCompletedEventAttributes {
|
|
|
193
193
|
string identity = 3;
|
|
194
194
|
// Binary ID of the worker who completed this task
|
|
195
195
|
string binary_checksum = 4;
|
|
196
|
-
//
|
|
197
|
-
// is
|
|
198
|
-
|
|
196
|
+
// Version info of the worker who processed this workflow task, or missing if worker is not
|
|
197
|
+
// using versioning. If present, the `build_id` field within is also used as `binary_checksum`,
|
|
198
|
+
// which may be omitted in that case (it may also be populated to preserve compatibility).
|
|
199
|
+
temporal.api.common.v1.WorkerVersionStamp worker_version = 5;
|
|
199
200
|
// Data the SDK wishes to record for itself, but server need not interpret, and does not
|
|
200
201
|
// directly impact workflow state.
|
|
201
202
|
temporal.api.sdk.v1.WorkflowTaskCompletedMetadata sdk_metadata = 6;
|
|
@@ -409,6 +410,8 @@ message WorkflowExecutionSignaledEventAttributes {
|
|
|
409
410
|
// Headers that were passed by the sender of the signal and copied by temporal
|
|
410
411
|
// server into the workflow task.
|
|
411
412
|
temporal.api.common.v1.Header header = 4;
|
|
413
|
+
// Indicates the signal did not generate a new workflow task when received.
|
|
414
|
+
bool skip_generate_workflow_task = 5;
|
|
412
415
|
}
|
|
413
416
|
|
|
414
417
|
message WorkflowExecutionTerminatedEventAttributes {
|
|
@@ -29,7 +29,7 @@ option java_package = "io.temporal.api.protocol.v1";
|
|
|
29
29
|
option java_multiple_files = true;
|
|
30
30
|
option java_outer_classname = "MessageProto";
|
|
31
31
|
option ruby_package = "Temporalio::Api::Protocol::V1";
|
|
32
|
-
option csharp_namespace = "
|
|
32
|
+
option csharp_namespace = "Temporalio.Api.Protocol.V1";
|
|
33
33
|
|
|
34
34
|
import "google/protobuf/any.proto";
|
|
35
35
|
|
|
@@ -38,6 +38,7 @@ import "google/protobuf/wrappers.proto";
|
|
|
38
38
|
import "dependencies/gogoproto/gogo.proto";
|
|
39
39
|
|
|
40
40
|
import "temporal/api/enums/v1/task_queue.proto";
|
|
41
|
+
import "temporal/api/common/v1/message.proto";
|
|
41
42
|
|
|
42
43
|
// See https://docs.temporal.io/docs/concepts/task-queues/
|
|
43
44
|
message TaskQueue {
|
|
@@ -71,13 +72,12 @@ message TaskQueuePartitionMetadata {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
message PollerInfo {
|
|
74
|
-
// Unix Nano
|
|
75
75
|
google.protobuf.Timestamp last_access_time = 1 [(gogoproto.stdtime) = true];
|
|
76
76
|
string identity = 2;
|
|
77
77
|
double rate_per_second = 3;
|
|
78
|
-
// If a worker has
|
|
79
|
-
//
|
|
80
|
-
|
|
78
|
+
// If a worker has opted into the worker versioning feature while polling, its capabilities will
|
|
79
|
+
// appear here.
|
|
80
|
+
temporal.api.common.v1.WorkerVersionCapabilities worker_version_capabilities = 4;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
message StickyExecutionAttributes {
|
|
@@ -87,22 +87,12 @@ message StickyExecutionAttributes {
|
|
|
87
87
|
google.protobuf.Duration schedule_to_start_timeout = 2 [(gogoproto.stdduration) = true];
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
// Used by the worker versioning APIs, represents
|
|
91
|
-
//
|
|
92
|
-
message
|
|
93
|
-
|
|
94
|
-
//
|
|
95
|
-
|
|
96
|
-
//
|
|
97
|
-
|
|
90
|
+
// Used by the worker versioning APIs, represents an ordering of one or more versions which are
|
|
91
|
+
// considered to be compatible with each other. Currently the versions are always worker build ids.
|
|
92
|
+
message CompatibleVersionSet {
|
|
93
|
+
// A unique identifier for this version set. Users don't need to understand or care about this
|
|
94
|
+
// value, but it has value for debugging purposes.
|
|
95
|
+
string version_set_id = 1;
|
|
96
|
+
// All the compatible versions, ordered from oldest to newest
|
|
97
|
+
repeated string build_ids = 2;
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
// Used by the worker versioning APIs, represents a specific version of something
|
|
101
|
-
// Currently, that's just a whole-worker id. In the future, if we support
|
|
102
|
-
// WASM workflow bundle based versioning, for example, then the inside of this
|
|
103
|
-
// message may become a oneof of different version types.
|
|
104
|
-
message VersionId {
|
|
105
|
-
// An opaque whole-worker identifier
|
|
106
|
-
string worker_build_id = 1;
|
|
107
|
-
}
|
|
108
|
-
|
|
@@ -35,8 +35,8 @@ import "temporal/api/common/v1/message.proto";
|
|
|
35
35
|
import "temporal/api/enums/v1/update.proto";
|
|
36
36
|
import "temporal/api/failure/v1/message.proto";
|
|
37
37
|
|
|
38
|
-
//
|
|
39
|
-
// call to wait before returning control to the caller.
|
|
38
|
+
// Specifies to the gRPC server how long the client wants the an update-related
|
|
39
|
+
// RPC call to wait before returning control to the caller.
|
|
40
40
|
message WaitPolicy {
|
|
41
41
|
|
|
42
42
|
// Indicates the update lifecycle stage that the gRPC call should wait for
|
|
@@ -57,6 +57,8 @@ message WorkflowExecutionInfo {
|
|
|
57
57
|
string task_queue = 13;
|
|
58
58
|
int64 state_transition_count = 14;
|
|
59
59
|
int64 history_size_bytes = 15;
|
|
60
|
+
// If set, the most recent worker version stamp that appeared in a workflow task completion
|
|
61
|
+
temporal.api.common.v1.WorkerVersionStamp most_recent_worker_version_stamp = 16;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
message WorkflowExecutionConfig {
|
|
@@ -180,6 +180,10 @@ message StartWorkflowExecutionRequest {
|
|
|
180
180
|
// StartWorkflowExecution.
|
|
181
181
|
temporal.api.failure.v1.Failure continued_failure = 18;
|
|
182
182
|
temporal.api.common.v1.Payloads last_completion_result = 19;
|
|
183
|
+
// Time to wait before dispatching the first workflow task. Cannot be used with `cron_schedule`.
|
|
184
|
+
// If the workflow gets a signal before the delay, a workflow task will be dispatched and the rest
|
|
185
|
+
// of the delay will be ignored.
|
|
186
|
+
google.protobuf.Duration workflow_start_delay = 20 [(gogoproto.stdduration) = true];
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
message StartWorkflowExecutionResponse {
|
|
@@ -237,12 +241,12 @@ message PollWorkflowTaskQueueRequest {
|
|
|
237
241
|
// Each worker process should provide an ID unique to the specific set of code it is running
|
|
238
242
|
// "checksum" in this field name isn't very accurate, it should be though of as an id.
|
|
239
243
|
string binary_checksum = 4;
|
|
240
|
-
// If set, the worker is opting in to
|
|
241
|
-
// receive tasks that are considered compatible with the version provided.
|
|
242
|
-
// Doing so only makes sense in conjunction with the `
|
|
243
|
-
// When
|
|
244
|
+
// If set, the worker is opting in to versioning and wishes to only
|
|
245
|
+
// receive tasks that are considered compatible with the version capabilities provided.
|
|
246
|
+
// Doing so only makes sense in conjunction with the `UpdateWorkerBuildIdCompatibility` API.
|
|
247
|
+
// When this field has a `worker_build_id`, and `binary_checksum` is not
|
|
244
248
|
// set, that value should also be considered as the `binary_checksum`.
|
|
245
|
-
temporal.api.
|
|
249
|
+
temporal.api.common.v1.WorkerVersionCapabilities worker_version_capabilities = 5;
|
|
246
250
|
}
|
|
247
251
|
|
|
248
252
|
message PollWorkflowTaskQueueResponse {
|
|
@@ -310,11 +314,12 @@ message RespondWorkflowTaskCompletedRequest {
|
|
|
310
314
|
// Responses to the `queries` field in the task being responded to
|
|
311
315
|
map<string, temporal.api.query.v1.WorkflowQueryResult> query_results = 8;
|
|
312
316
|
string namespace = 9;
|
|
313
|
-
// If using versioning, worker
|
|
314
|
-
//
|
|
315
|
-
//
|
|
316
|
-
//
|
|
317
|
-
|
|
317
|
+
// If using versioning, the worker uses this field to indicate what version(s) it used to
|
|
318
|
+
// process the task. When this field has a `worker_build_id`, and `binary_checksum` is not set,
|
|
319
|
+
// that value should also be considered as the `binary_checksum`. Leaving this field empty when
|
|
320
|
+
// replying to a task has had this field previously populated in history in an error, and such
|
|
321
|
+
// a completion will be rejected.
|
|
322
|
+
temporal.api.common.v1.WorkerVersionStamp worker_version_stamp = 10;
|
|
318
323
|
// Protocol messages piggybacking on a WFT as a transport
|
|
319
324
|
repeated temporal.api.protocol.v1.Message messages = 11;
|
|
320
325
|
// Data the SDK wishes to record for itself, but server need not interpret, and does not
|
|
@@ -359,10 +364,10 @@ message PollActivityTaskQueueRequest {
|
|
|
359
364
|
// The identity of the worker/client
|
|
360
365
|
string identity = 3;
|
|
361
366
|
temporal.api.taskqueue.v1.TaskQueueMetadata task_queue_metadata = 4;
|
|
362
|
-
// If set, the worker is opting in to
|
|
363
|
-
// receive tasks that are considered compatible with the
|
|
364
|
-
// Doing so only makes sense in conjunction with the `
|
|
365
|
-
temporal.api.
|
|
367
|
+
// If set, the worker is opting in to versioning and wishes to only
|
|
368
|
+
// receive tasks that are considered compatible with the capabilities provided.
|
|
369
|
+
// Doing so only makes sense in conjunction with the `UpdateWorkerBuildIdCompatibility` API.
|
|
370
|
+
temporal.api.common.v1.WorkerVersionCapabilities worker_version_capabilities = 5;
|
|
366
371
|
}
|
|
367
372
|
|
|
368
373
|
message PollActivityTaskQueueResponse {
|
|
@@ -587,6 +592,8 @@ message SignalWorkflowExecutionRequest {
|
|
|
587
592
|
// Headers that are passed with the signal to the processing workflow.
|
|
588
593
|
// These can include things like auth or tracing tokens.
|
|
589
594
|
temporal.api.common.v1.Header header = 8;
|
|
595
|
+
// Indicates that a new workflow task should not be generated when this signal is received.
|
|
596
|
+
bool skip_generate_workflow_task = 9;
|
|
590
597
|
}
|
|
591
598
|
|
|
592
599
|
message SignalWorkflowExecutionResponse {
|
|
@@ -624,6 +631,15 @@ message SignalWithStartWorkflowExecutionRequest {
|
|
|
624
631
|
temporal.api.common.v1.Memo memo = 17;
|
|
625
632
|
temporal.api.common.v1.SearchAttributes search_attributes = 18;
|
|
626
633
|
temporal.api.common.v1.Header header = 19;
|
|
634
|
+
// Time to wait before dispatching the first workflow task. Cannot be used with `cron_schedule`.
|
|
635
|
+
// Note that the signal will be delivered with the first workflow task. If the workflow gets
|
|
636
|
+
// another SignalWithStartWorkflow before the delay and `skip_generate_workflow_task` is false
|
|
637
|
+
// or not set, a workflow task will be dispatched immediately and the rest of the delay period
|
|
638
|
+
// will be ignored, even if that request also had a delay. Signal via SignalWorkflowExecution
|
|
639
|
+
// will not unblock the workflow.
|
|
640
|
+
google.protobuf.Duration workflow_start_delay = 20 [(gogoproto.stdduration) = true];
|
|
641
|
+
// Indicates that a new workflow task should not be generated when this signal is received.
|
|
642
|
+
bool skip_generate_workflow_task = 21;
|
|
627
643
|
}
|
|
628
644
|
|
|
629
645
|
message SignalWithStartWorkflowExecutionResponse {
|
|
@@ -1038,47 +1054,106 @@ message ListSchedulesResponse {
|
|
|
1038
1054
|
}
|
|
1039
1055
|
|
|
1040
1056
|
// (-- api-linter: core::0134::request-mask-required=disabled
|
|
1041
|
-
// aip.dev/not-precedent:
|
|
1057
|
+
// aip.dev/not-precedent: UpdateWorkerBuildIdCompatibilityRequest doesn't follow Google API format --)
|
|
1042
1058
|
// (-- api-linter: core::0134::request-resource-required=disabled
|
|
1043
|
-
// aip.dev/not-precedent:
|
|
1044
|
-
message
|
|
1059
|
+
// aip.dev/not-precedent: UpdateWorkerBuildIdCompatibilityRequest RPC doesn't follow Google API format. --)
|
|
1060
|
+
message UpdateWorkerBuildIdCompatibilityRequest {
|
|
1061
|
+
message AddNewCompatibleVersion {
|
|
1062
|
+
// A new id to be added to an existing compatible set.
|
|
1063
|
+
string new_build_id = 1;
|
|
1064
|
+
// A build id which must already exist in the version sets known by the task queue. The new
|
|
1065
|
+
// id will be stored in the set containing this id, marking it as compatible with
|
|
1066
|
+
// the versions within.
|
|
1067
|
+
string existing_compatible_build_id = 2;
|
|
1068
|
+
// When set, establishes the compatible set being targeted as the overall default for the
|
|
1069
|
+
// queue. If a different set was the current default, the targeted set will replace it as
|
|
1070
|
+
// the new default.
|
|
1071
|
+
bool make_set_default = 3;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1045
1074
|
string namespace = 1;
|
|
1046
|
-
// Must be set, the task queue to apply changes to. Because all workers on
|
|
1047
|
-
//
|
|
1048
|
-
//
|
|
1075
|
+
// Must be set, the task queue to apply changes to. Because all workers on a given task queue
|
|
1076
|
+
// must have the same set of workflow & activity implementations, there is no reason to specify
|
|
1077
|
+
// a task queue type here.
|
|
1049
1078
|
string task_queue = 2;
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1079
|
+
oneof operation {
|
|
1080
|
+
// A new build id. This operation will create a new set which will be the new overall
|
|
1081
|
+
// default version for the queue, with this id as its only member. This new set is
|
|
1082
|
+
// incompatible with all previous sets/versions.
|
|
1083
|
+
//
|
|
1084
|
+
// (-- api-linter: core::0140::prepositions=disabled
|
|
1085
|
+
// aip.dev/not-precedent: In makes perfect sense here. --)
|
|
1086
|
+
string add_new_build_id_in_new_default_set = 3;
|
|
1087
|
+
// Adds a new id to an existing compatible set, see sub-message definition for more.
|
|
1088
|
+
AddNewCompatibleVersion add_new_compatible_build_id = 4;
|
|
1089
|
+
// Promote an existing set to be the current default (if it isn't already) by targeting
|
|
1090
|
+
// an existing build id within it. This field's value is the extant build id.
|
|
1091
|
+
//
|
|
1092
|
+
// (-- api-linter: core::0140::prepositions=disabled
|
|
1093
|
+
// aip.dev/not-precedent: Names are hard. --)
|
|
1094
|
+
string promote_set_by_build_id = 5;
|
|
1095
|
+
// Promote an existing build id within some set to be the current default for that set.
|
|
1096
|
+
//
|
|
1097
|
+
// (-- api-linter: core::0140::prepositions=disabled
|
|
1098
|
+
// aip.dev/not-precedent: Within makes perfect sense here. --)
|
|
1099
|
+
string promote_build_id_within_set = 6;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
message UpdateWorkerBuildIdCompatibilityResponse {
|
|
1103
|
+
// The id of the compatible set that the updated version was added to, or exists in. Users don't
|
|
1104
|
+
// need to understand or care about this value, but it has value for debugging purposes.
|
|
1105
|
+
string version_set_id = 1;
|
|
1106
|
+
}
|
|
1064
1107
|
|
|
1065
1108
|
// (-- api-linter: core::0134::request-resource-required=disabled
|
|
1066
|
-
// aip.dev/not-precedent:
|
|
1067
|
-
message
|
|
1109
|
+
// aip.dev/not-precedent: GetWorkerBuildIdCompatibilityRequest RPC doesn't follow Google API format. --)
|
|
1110
|
+
message GetWorkerBuildIdCompatibilityRequest {
|
|
1068
1111
|
string namespace = 1;
|
|
1069
|
-
// Must be set, the task queue to interrogate about worker id
|
|
1112
|
+
// Must be set, the task queue to interrogate about worker id compatibility.
|
|
1070
1113
|
string task_queue = 2;
|
|
1071
|
-
// Limits how
|
|
1072
|
-
// default
|
|
1073
|
-
int32
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
//
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1114
|
+
// Limits how many compatible sets will be returned. Specify 1 to only return the current
|
|
1115
|
+
// default major version set. 0 returns all sets.
|
|
1116
|
+
int32 max_sets = 3;
|
|
1117
|
+
// If set, the response will include information about worker versions which are ready to be
|
|
1118
|
+
// retired.
|
|
1119
|
+
bool include_retirement_candidates = 4;
|
|
1120
|
+
// If set, the response will include information about which versions have open workflows, and
|
|
1121
|
+
// whether or not there are currently polling workers who are compatible with those versions.
|
|
1122
|
+
bool include_poller_compatibility = 5;
|
|
1123
|
+
}
|
|
1124
|
+
message GetWorkerBuildIdCompatibilityResponse {
|
|
1125
|
+
// Major version sets, in order from oldest to newest. The last element of the list will always
|
|
1126
|
+
// be the current default major version. IE: New workflows will target the most recent version
|
|
1127
|
+
// in that version set.
|
|
1128
|
+
//
|
|
1129
|
+
// There may be fewer sets returned than exist, if the request chose to limit this response.
|
|
1130
|
+
repeated temporal.api.taskqueue.v1.CompatibleVersionSet major_version_sets = 1;
|
|
1131
|
+
|
|
1132
|
+
message RetirementCandidate {
|
|
1133
|
+
// The worker build id which is ready for retirement
|
|
1134
|
+
string build_id = 1;
|
|
1135
|
+
// If true, there are no open *or* closed workflows, meaning there is no reason at all
|
|
1136
|
+
// to keep the worker alive, not even to service queries on closed workflows. If not true,
|
|
1137
|
+
// then there are no open workflows, but some closed ones.
|
|
1138
|
+
bool all_workflows_are_archived = 2;
|
|
1139
|
+
// Currently polling workers who match the build id ready for retirement
|
|
1140
|
+
repeated temporal.api.taskqueue.v1.PollerInfo pollers = 3;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
// A list of workers who are still live and polling the task queue, but may no longer be needed
|
|
1144
|
+
// to make progress on open workflows.
|
|
1145
|
+
repeated RetirementCandidate retirement_candidates = 2;
|
|
1146
|
+
|
|
1147
|
+
message VersionsWithCompatiblePollers {
|
|
1148
|
+
// The latest build id which completed a workflow task on some open workflow
|
|
1149
|
+
string most_recent_build_id = 1;
|
|
1150
|
+
// Currently polling workers who are compatible with `most_recent_build_id`.
|
|
1151
|
+
repeated temporal.api.taskqueue.v1.PollerInfo pollers = 2;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
// A list of versions and pollers who are capable of processing tasks at that version (if any)
|
|
1155
|
+
// for which there are currently open workflows.
|
|
1156
|
+
repeated VersionsWithCompatiblePollers active_versions_and_pollers = 3;
|
|
1082
1157
|
}
|
|
1083
1158
|
|
|
1084
1159
|
// (-- api-linter: core::0134=disabled
|
|
@@ -1197,3 +1272,25 @@ message ListBatchOperationsResponse {
|
|
|
1197
1272
|
repeated temporal.api.batch.v1.BatchOperationInfo operation_info = 1;
|
|
1198
1273
|
bytes next_page_token = 2;
|
|
1199
1274
|
}
|
|
1275
|
+
|
|
1276
|
+
message PollWorkflowExecutionUpdateRequest {
|
|
1277
|
+
// The namespace of the workflow execution to which the update was
|
|
1278
|
+
// originally issued.
|
|
1279
|
+
string namespace = 1;
|
|
1280
|
+
// The update reference returned in the initial
|
|
1281
|
+
// UpdateWorkflowExecutionResponse
|
|
1282
|
+
temporal.api.update.v1.UpdateRef update_ref = 2;
|
|
1283
|
+
// The identity of the worker/client who is polling this update outcome
|
|
1284
|
+
string identity = 3;
|
|
1285
|
+
// Describes when this poll request should return a response
|
|
1286
|
+
temporal.api.update.v1.WaitPolicy wait_policy = 4;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
message PollWorkflowExecutionUpdateResponse {
|
|
1290
|
+
// The outcome of the update if and only if the update has completed. If
|
|
1291
|
+
// this response is being returned before the update has completed (e.g. due
|
|
1292
|
+
// to the specification of a wait policy that only waits on
|
|
1293
|
+
// UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED) then this field will
|
|
1294
|
+
// not be set.
|
|
1295
|
+
temporal.api.update.v1.Outcome outcome = 1;
|
|
1296
|
+
}
|
|
@@ -380,16 +380,18 @@ service WorkflowService {
|
|
|
380
380
|
rpc ListSchedules (ListSchedulesRequest) returns (ListSchedulesResponse) {
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
// Allows users to specify
|
|
384
|
-
//
|
|
385
|
-
//
|
|
383
|
+
// Allows users to specify sets of worker build id versions on a per task queue basis. Versions
|
|
384
|
+
// are ordered, and may be either compatible with some extant version, or a new incompatible
|
|
385
|
+
// version, forming sets of ids which are incompatible with each other, but whose contained
|
|
386
|
+
// members are compatible with one another.
|
|
387
|
+
//
|
|
386
388
|
// (-- api-linter: core::0134::response-message-name=disabled
|
|
387
|
-
// aip.dev/not-precedent:
|
|
389
|
+
// aip.dev/not-precedent: UpdateWorkerBuildIdCompatibility RPC doesn't follow Google API format. --)
|
|
388
390
|
// (-- api-linter: core::0134::method-signature=disabled
|
|
389
|
-
// aip.dev/not-precedent:
|
|
390
|
-
rpc
|
|
391
|
-
// Fetches the worker build id versioning
|
|
392
|
-
rpc
|
|
391
|
+
// aip.dev/not-precedent: UpdateWorkerBuildIdCompatibility RPC doesn't follow Google API format. --)
|
|
392
|
+
rpc UpdateWorkerBuildIdCompatibility (UpdateWorkerBuildIdCompatibilityRequest) returns (UpdateWorkerBuildIdCompatibilityResponse) {}
|
|
393
|
+
// Fetches the worker build id versioning sets for some task queue and related metadata.
|
|
394
|
+
rpc GetWorkerBuildIdCompatibility (GetWorkerBuildIdCompatibilityRequest) returns (GetWorkerBuildIdCompatibilityResponse) {}
|
|
393
395
|
|
|
394
396
|
// Invokes the specified update function on user workflow code.
|
|
395
397
|
// (-- api-linter: core::0134=disabled
|
|
@@ -397,6 +399,15 @@ service WorkflowService {
|
|
|
397
399
|
rpc UpdateWorkflowExecution(UpdateWorkflowExecutionRequest) returns (UpdateWorkflowExecutionResponse) {
|
|
398
400
|
}
|
|
399
401
|
|
|
402
|
+
// Polls a workflow execution for the outcome of a workflow execution update
|
|
403
|
+
// previously issued through the UpdateWorkflowExecution RPC. The effective
|
|
404
|
+
// timeout on this call will be shorter of the the caller-supplied gRPC
|
|
405
|
+
// timeout and the server's configured long-poll timeout.
|
|
406
|
+
// (-- api-linter: core::0134=disabled
|
|
407
|
+
// aip.dev/not-precedent: UpdateWorkflowExecution doesn't follow Google API format --)
|
|
408
|
+
rpc PollWorkflowExecutionUpdate(PollWorkflowExecutionUpdateRequest) returns (PollWorkflowExecutionUpdateResponse){
|
|
409
|
+
}
|
|
410
|
+
|
|
400
411
|
// StartBatchOperation starts a new batch operation
|
|
401
412
|
rpc StartBatchOperation(StartBatchOperationRequest) returns (StartBatchOperationResponse) {
|
|
402
413
|
}
|
|
@@ -11,7 +11,7 @@ use crate::{
|
|
|
11
11
|
SignalExternalWfResult, TimerResult, UnblockEvent, Unblockable,
|
|
12
12
|
};
|
|
13
13
|
use crossbeam::channel::{Receiver, Sender};
|
|
14
|
-
use futures::{task::Context, FutureExt, Stream};
|
|
14
|
+
use futures::{task::Context, FutureExt, Stream, StreamExt};
|
|
15
15
|
use parking_lot::RwLock;
|
|
16
16
|
use std::{
|
|
17
17
|
collections::HashMap,
|
|
@@ -398,6 +398,14 @@ impl DrainableSignalStream {
|
|
|
398
398
|
}
|
|
399
399
|
signals
|
|
400
400
|
}
|
|
401
|
+
|
|
402
|
+
pub fn drain_ready(&mut self) -> Vec<SignalData> {
|
|
403
|
+
let mut signals = vec![];
|
|
404
|
+
while let Some(s) = self.0.next().now_or_never().flatten() {
|
|
405
|
+
signals.push(s);
|
|
406
|
+
}
|
|
407
|
+
signals
|
|
408
|
+
}
|
|
401
409
|
}
|
|
402
410
|
|
|
403
411
|
impl Stream for DrainableSignalStream {
|