Skip to content

Commit

Permalink
Update core and update release version to 1.7.1 (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz authored Sep 11, 2024
1 parent 59d04a6 commit 09ac120
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 54 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ generated via `poe gen-protos`. Tests can be run for protobuf version 3 by setti
to `1` prior to running tests.

Do not commit `poetry.lock` or `pyproject.toml` changes. To go back from this downgrade, restore both of those files
and run `poetry install --no-root --all extras`.
and run `poetry install --no-root --all-extras`. Make sure you `poe format` the results.

For a less system-intrusive approach, you can (note this approach [may have a bug](https://github.com/temporalio/sdk-python/issues/543)):
```shell
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "temporalio"
version = "1.7.0"
version = "1.7.1"
description = "Temporal.io Python SDK"
license = "MIT"
authors = ["Temporal Technologies Inc <[email protected]>"]
Expand Down
31 changes: 22 additions & 9 deletions temporalio/bridge/Cargo.lock

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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,37 @@ class WorkflowActivation(google.protobuf.message.Message):
## Job ordering guarantees and semantics
Core will, by default, order jobs within the activation as follows:
`patches -> signals/updates -> other -> queries -> evictions`
1. patches
2. random-seed-updates
3. signals/updates
4. all others
5. local activity resolutions
6. queries
7. evictions
This is because:
* Patches are expected to apply to the entire activation
* Signal and update handlers should be invoked before workflow routines are iterated. That is to
say before the users' main workflow function and anything spawned by it is allowed to continue.
* Local activities resolutions go after other normal jobs because while *not* replaying, they
will always take longer than anything else that produces an immediate job (which is
effectively instant). When *replaying* we need to scan ahead for LA markers so that we can
resolve them in the same activation that they completed in when not replaying. However, doing
so would, by default, put those resolutions *before* any other immediate jobs that happened
in that same activation (prime example: cancelling not-wait-for-cancel activities). So, we do
this to ensure the LA resolution happens after that cancel (or whatever else it may be) as it
normally would have when executing.
* Queries always go last (and, in fact, always come in their own activation)
* Evictions also always come in their own activation
The downside of this reordering is that a signal or update handler may not observe that some
other event had already happened (ex: an activity completed) when it is first invoked, though it
will subsequently when workflow routines are driven. Core only does this reordering to make life
easier for languages that cannot explicitly control when workflow routines are iterated.
Languages that can explicitly control such iteration should prefer to apply all the jobs to state
(by resolving promises/futures, invoking handlers, etc as they iterate over the jobs) and then
only *after* that is done, drive the workflow routines.
Core does this reordering to ensure that langs observe jobs in the same order during replay as
they would have during execution. However, in principle, this ordering is not necessary
(excepting queries/evictions, which definitely must come last) if lang layers apply all jobs to
state *first* (by resolving promises/futures, marking handlers to be invoked, etc as they iterate
over the jobs) and then only *after* that is done, drive coroutines/threads/whatever. If
execution works this way, then determinism is only impacted by the order routines are driven in
(which must be stable based on lang implementation or convention), rather than the order jobs are
processed.
## Evictions
Expand Down Expand Up @@ -628,6 +643,7 @@ class ResolveActivity(google.protobuf.message.Message):

SEQ_FIELD_NUMBER: builtins.int
RESULT_FIELD_NUMBER: builtins.int
IS_LOCAL_FIELD_NUMBER: builtins.int
seq: builtins.int
"""Sequence number as provided by lang in the corresponding ScheduleActivity command"""
@property
Expand All @@ -636,18 +652,26 @@ class ResolveActivity(google.protobuf.message.Message):
) -> (
temporalio.bridge.proto.activity_result.activity_result_pb2.ActivityResolution
): ...
is_local: builtins.bool
"""Set to true if the resolution is for a local activity. This is used internally by Core and
lang does not need to care about it.
"""
def __init__(
self,
*,
seq: builtins.int = ...,
result: temporalio.bridge.proto.activity_result.activity_result_pb2.ActivityResolution
| None = ...,
is_local: builtins.bool = ...,
) -> None: ...
def HasField(
self, field_name: typing_extensions.Literal["result", b"result"]
) -> builtins.bool: ...
def ClearField(
self, field_name: typing_extensions.Literal["result", b"result", "seq", b"seq"]
self,
field_name: typing_extensions.Literal[
"is_local", b"is_local", "result", b"result", "seq", b"seq"
],
) -> None: ...

global___ResolveActivity = ResolveActivity
Expand Down
2 changes: 1 addition & 1 deletion temporalio/bridge/sdk-core
Submodule sdk-core updated 38 files
+7 −1 .github/workflows/per-pr.yml
+1 −1 client/Cargo.toml
+1 −1 client/src/lib.rs
+39 −13 client/src/raw.rs
+108 −62 client/src/retry.rs
+1 −2 client/src/workflow_handle/mod.rs
+1 −0 core-api/src/telemetry.rs
+1 −1 core/Cargo.toml
+13 −13 core/src/core_tests/workflow_tasks.rs
+3 −0 core/src/protosext/mod.rs
+0 −8 core/src/telemetry/mod.rs
+7 −3 core/src/telemetry/otel.rs
+1 −1 core/src/worker/activities.rs
+11 −0 core/src/worker/activities/activity_task_poller_stream.rs
+6 −6 core/src/worker/mod.rs
+2 −1 core/src/worker/slot_provider.rs
+28 −2 core/src/worker/workflow/driven_workflow.rs
+3 −0 core/src/worker/workflow/machines/activity_state_machine.rs
+7 −12 core/src/worker/workflow/machines/local_activity_state_machine.rs
+19 −9 core/src/worker/workflow/machines/workflow_machines.rs
+5 −3 core/src/worker/workflow/managed_run.rs
+16 −18 core/src/worker/workflow/mod.rs
+4 −4 docker/docker-compose-telem.yaml
+12 −9 etc/otel-collector-config.yaml
+26 −8 sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto
+93 −56 sdk-core-protos/src/lib.rs
+1 −1 sdk/src/lib.rs
+9 −2 sdk/src/workflow_context.rs
+16 −3 sdk/src/workflow_future.rs
+2 −3 test-utils/src/lib.rs
+36 −7 tests/integ_tests/client_tests.rs
+1 −1 tests/integ_tests/heartbeat_tests.rs
+49 −4 tests/integ_tests/metrics_tests.rs
+0 −2 tests/integ_tests/queries_tests.rs
+46 −8 tests/integ_tests/workflow_tests/activities.rs
+81 −2 tests/integ_tests/workflow_tests/local_activities.rs
+35 −12 tests/integ_tests/workflow_tests/upsert_search_attrs.rs
+28 −19 tests/main.rs
2 changes: 1 addition & 1 deletion temporalio/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import temporalio.exceptions
import temporalio.runtime

__version__ = "1.7.0"
__version__ = "1.7.1"

ServiceRequest = TypeVar("ServiceRequest", bound=google.protobuf.message.Message)
ServiceResponse = TypeVar("ServiceResponse", bound=google.protobuf.message.Message)
Expand Down

0 comments on commit 09ac120

Please sign in to comment.