Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/added/headier-mackenzie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Core: A local activity's `ActivityTask.Start` has `workflow_task` (field 21), with the started event id, attempt and start time of the workflow task in which Core dispatched it. `workflow_task` also has `previous_started_event_id`, `previous_attempt` and `previous_started_time`, which name the run's last completed workflow task, and `failed_tasks`, the started event ids of the run's last 100 failed or timed out workflow tasks. Retries that Core runs locally keep the value. Core leaves it unset for other activities.
Core: Client environment config profiles include the raw TOML tables under `profile.<name>.ext`, keyed by extension name, for SDK envconfig extensions. Strict mode accepts any content under `ext`. The C bridge's profile JSON includes them as an `ext` object, with TOML datetimes as strings.
3 changes: 3 additions & 0 deletions changelog/fixed/headier-mackenzie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Core: A workflow task failure reported with the cause `WORKFLOW_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE` is now counted on `workflow_task_execution_failed` with `failure_reason="ExternalStorageError"`, matching activity failures with the storage cause. It was previously counted as `WorkflowError`.
Core: Ephemeral dev and test servers now complete the automatic port reservation handshake on Linux and macOS before starting, preventing intermittent address-in-use errors during TCP teardown.
Core: Resource-based worker tuners now read CPU usage and quotas from standard cgroup v1 mounts. Workers on cgroup v1 systems no longer fall back to host CPU usage and admit work based on understated container load.
4 changes: 2 additions & 2 deletions temporalio/bridge/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions temporalio/bridge/proto/activity_task/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ActivityTask,
Cancel,
Start,
WorkflowTaskAttempt,
)

__all__ = [
Expand All @@ -12,4 +13,5 @@
"ActivityTask",
"Cancel",
"Start",
"WorkflowTaskAttempt",
]
34 changes: 24 additions & 10 deletions temporalio/bridge/proto/activity_task/activity_task_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 88 additions & 0 deletions temporalio/bridge/proto/activity_task/activity_task_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class Start(google.protobuf.message.Message):
IS_LOCAL_FIELD_NUMBER: builtins.int
RUN_ID_FIELD_NUMBER: builtins.int
PROPAGATED_NEXUS_SERIALIZATION_CONTEXT_FIELD_NUMBER: builtins.int
WORKFLOW_TASK_FIELD_NUMBER: builtins.int
workflow_namespace: builtins.str
"""The namespace the workflow lives in"""
workflow_type: builtins.str
Expand Down Expand Up @@ -237,6 +238,11 @@ class Start(google.protobuf.message.Message):
Only set for standalone activities. Lang should use it to serialize the activity's result and
failure, which are returned to the Nexus caller.
"""
@property
def workflow_task(self) -> global___WorkflowTaskAttempt:
"""For a local activity, the workflow task in which Core dispatched this execution. Retries that
Core runs locally keep the value. Unset for other activities.
"""
def __init__(
self,
*,
Expand Down Expand Up @@ -270,6 +276,7 @@ class Start(google.protobuf.message.Message):
run_id: builtins.str = ...,
propagated_nexus_serialization_context: temporalio.api.nexus.v1.message_pb2.PropagatedSerializationContext
| None = ...,
workflow_task: global___WorkflowTaskAttempt | None = ...,
) -> None: ...
def HasField(
self,
Expand All @@ -294,6 +301,8 @@ class Start(google.protobuf.message.Message):
b"started_time",
"workflow_execution",
b"workflow_execution",
"workflow_task",
b"workflow_task",
],
) -> builtins.bool: ...
def ClearField(
Expand Down Expand Up @@ -337,13 +346,92 @@ class Start(google.protobuf.message.Message):
b"workflow_execution",
"workflow_namespace",
b"workflow_namespace",
"workflow_task",
b"workflow_task",
"workflow_type",
b"workflow_type",
],
) -> None: ...

global___Start = Start

class WorkflowTaskAttempt(google.protobuf.message.Message):
"""One attempt of a workflow task, from the poll response and the history of that attempt."""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

STARTED_EVENT_ID_FIELD_NUMBER: builtins.int
ATTEMPT_FIELD_NUMBER: builtins.int
STARTED_TIME_FIELD_NUMBER: builtins.int
PREVIOUS_STARTED_EVENT_ID_FIELD_NUMBER: builtins.int
FAILED_TASKS_FIELD_NUMBER: builtins.int
PREVIOUS_ATTEMPT_FIELD_NUMBER: builtins.int
PREVIOUS_STARTED_TIME_FIELD_NUMBER: builtins.int
started_event_id: builtins.int
"""The event id of the task's WorkflowTaskStarted event."""
attempt: builtins.int
@property
def started_time(self) -> google.protobuf.timestamp_pb2.Timestamp:
"""When the server started the task."""
previous_started_event_id: builtins.int
"""The started event id of the run's last completed workflow task, from the poll response.
0 when no task of the run has completed.
"""
@property
def failed_tasks(
self,
) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
"""The started event ids of the run's last 100 failed and timed out workflow tasks in history,
in event order. The cap keeps each start small. A transient attempt has no such event.
"""
previous_attempt: builtins.int
"""The attempt and the started time of the task at previous_started_event_id, from its
WorkflowTaskScheduled and WorkflowTaskStarted events. Unset when no task has completed.
"""
@property
def previous_started_time(self) -> google.protobuf.timestamp_pb2.Timestamp: ...
def __init__(
self,
*,
started_event_id: builtins.int = ...,
attempt: builtins.int = ...,
started_time: google.protobuf.timestamp_pb2.Timestamp | None = ...,
previous_started_event_id: builtins.int = ...,
failed_tasks: collections.abc.Iterable[builtins.int] | None = ...,
previous_attempt: builtins.int = ...,
previous_started_time: google.protobuf.timestamp_pb2.Timestamp | None = ...,
) -> None: ...
def HasField(
self,
field_name: typing_extensions.Literal[
"previous_started_time",
b"previous_started_time",
"started_time",
b"started_time",
],
) -> builtins.bool: ...
def ClearField(
self,
field_name: typing_extensions.Literal[
"attempt",
b"attempt",
"failed_tasks",
b"failed_tasks",
"previous_attempt",
b"previous_attempt",
"previous_started_event_id",
b"previous_started_event_id",
"previous_started_time",
b"previous_started_time",
"started_event_id",
b"started_event_id",
"started_time",
b"started_time",
],
) -> None: ...

global___WorkflowTaskAttempt = WorkflowTaskAttempt

class Cancel(google.protobuf.message.Message):
"""Attempt to cancel a running activity"""

Expand Down
2 changes: 1 addition & 1 deletion temporalio/bridge/sdk-core
Submodule sdk-core updated 71 files
+1 −1 .github/actions/setup/action.yml
+3 −9 .github/workflows/per-pr.yml
+1 −0 changelog/added/extension-extraordinaire.md
+1 −0 changelog/added/hoarding-hamster.md
+1 −0 changelog/added/tracing-tap-dancing-toucan.md
+1 −0 changelog/fixed/counting-corgi.md
+1 −0 changelog/fixed/dancing-update.md
+1 −0 changelog/fixed/reserving-rutabaga.md
+1 −0 changelog/fixed/schedule-sheltering-salamander.md
+1 −0 changelog/fixed/watchful-waffle.md
+1 −0 changelog/fixed/whispering-walrus.md
+2 −2 crates/client/Cargo.toml
+8 −2 crates/client/src/activity/activity_execution_info.rs
+51 −4 crates/client/src/activity/activity_handle.rs
+53 −16 crates/client/src/async_activity_handle.rs
+409 −1 crates/client/src/envconfig.rs
+199 −57 crates/client/src/lib.rs
+16 −21 crates/client/src/options_structs.rs
+415 −40 crates/client/src/schedules.rs
+195 −30 crates/client/src/workflow_handle.rs
+1 −1 crates/common-wasm/Cargo.toml
+20 −1 crates/common-wasm/src/data_converters.rs
+40 −13 crates/common-wasm/src/external_storage.rs
+1 −1 crates/common/Cargo.toml
+21 −15 crates/common/build.rs
+93 −0 crates/common/src/envconfig.rs
+244 −0 crates/common/src/external_storage/mod.rs
+11 −23 crates/common/src/external_storage/references.rs
+286 −100 crates/common/src/external_storage/runner.rs
+2 −3 crates/common/src/lib.rs
+107 −45 crates/common/src/payload_visitor.rs
+22 −0 crates/protos/protos/local/temporal/sdk/core/activity_task/activity_task.proto
+1 −0 crates/protos/src/protos/mod.rs
+17 −1 crates/sdk-core-c-bridge/include/temporal-sdk-core-c-bridge.h
+87 −1 crates/sdk-core-c-bridge/src/envconfig.rs
+42 −12 crates/sdk-core-c-bridge/src/worker.rs
+20 −0 crates/sdk-core/CHANGELOG.md
+2 −2 crates/sdk-core/Cargo.toml
+276 −0 crates/sdk-core/src/core_tests/local_activity_workflow_task.rs
+1 −0 crates/sdk-core/src/core_tests/mod.rs
+176 −2 crates/sdk-core/src/core_tests/workers.rs
+13 −11 crates/sdk-core/src/ephemeral_server/mod.rs
+3 −3 crates/sdk-core/src/pollers/mod.rs
+60 −60 crates/sdk-core/src/pollers/poll_buffer.rs
+226 −0 crates/sdk-core/src/pollers/sticky.rs
+4 −0 crates/sdk-core/src/protosext/mod.rs
+6 −0 crates/sdk-core/src/replay/history_info.rs
+1 −0 crates/sdk-core/src/telemetry/metrics.rs
+23 −1 crates/sdk-core/src/worker/activities/local_activities.rs
+5 −49 crates/sdk-core/src/worker/mod.rs
+228 −177 crates/sdk-core/src/worker/nexus.rs
+143 −31 crates/sdk-core/src/worker/tuner/resource_based.rs
+1 −0 crates/sdk-core/src/worker/workflow/history_update.rs
+92 −1 crates/sdk-core/src/worker/workflow/machines/workflow_machines.rs
+2 −0 crates/sdk-core/src/worker/workflow/machines/workflow_machines/local_acts.rs
+40 −1 crates/sdk-core/src/worker/workflow/managed_run.rs
+7 −1 crates/sdk-core/src/worker/workflow/mod.rs
+13 −135 crates/sdk-core/src/worker/workflow/wft_poller.rs
+5 −1 crates/sdk-core/tests/common/mod.rs
+2 −1 crates/sdk-core/tests/integ_tests/data_converter_tests.rs
+1,442 −0 crates/sdk-core/tests/integ_tests/external_storage_tests.rs
+71 −0 crates/sdk-core/tests/integ_tests/metrics_tests.rs
+150 −5 crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs
+1 −0 crates/sdk-core/tests/main.rs
+1 −1 crates/sdk/Cargo.toml
+16 −2 crates/sdk/src/activities.rs
+414 −57 crates/sdk/src/lib.rs
+207 −20 crates/sdk/src/opentelemetry.rs
+13 −1 crates/sdk/src/plugins.rs
+5 −1 crates/sdk/src/workflow_replayer.rs
+1 −1 crates/workflow/Cargo.toml
Loading