Skip to content

Commit 09ac120

Browse files
authored
Update core and update release version to 1.7.1 (#640)
1 parent 59d04a6 commit 09ac120

File tree

7 files changed

+91
-54
lines changed

7 files changed

+91
-54
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ generated via `poe gen-protos`. Tests can be run for protobuf version 3 by setti
14761476
to `1` prior to running tests.
14771477

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

14811481
For a less system-intrusive approach, you can (note this approach [may have a bug](https://github.com/temporalio/sdk-python/issues/543)):
14821482
```shell

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "temporalio"
3-
version = "1.7.0"
3+
version = "1.7.1"
44
description = "Temporal.io Python SDK"
55
license = "MIT"
66
authors = ["Temporal Technologies Inc <[email protected]>"]

temporalio/bridge/Cargo.lock

+22-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/bridge/proto/workflow_activation/workflow_activation_pb2.py

+32-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/bridge/proto/workflow_activation/workflow_activation_pb2.pyi

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

629644
SEQ_FIELD_NUMBER: builtins.int
630645
RESULT_FIELD_NUMBER: builtins.int
646+
IS_LOCAL_FIELD_NUMBER: builtins.int
631647
seq: builtins.int
632648
"""Sequence number as provided by lang in the corresponding ScheduleActivity command"""
633649
@property
@@ -636,18 +652,26 @@ class ResolveActivity(google.protobuf.message.Message):
636652
) -> (
637653
temporalio.bridge.proto.activity_result.activity_result_pb2.ActivityResolution
638654
): ...
655+
is_local: builtins.bool
656+
"""Set to true if the resolution is for a local activity. This is used internally by Core and
657+
lang does not need to care about it.
658+
"""
639659
def __init__(
640660
self,
641661
*,
642662
seq: builtins.int = ...,
643663
result: temporalio.bridge.proto.activity_result.activity_result_pb2.ActivityResolution
644664
| None = ...,
665+
is_local: builtins.bool = ...,
645666
) -> None: ...
646667
def HasField(
647668
self, field_name: typing_extensions.Literal["result", b"result"]
648669
) -> builtins.bool: ...
649670
def ClearField(
650-
self, field_name: typing_extensions.Literal["result", b"result", "seq", b"seq"]
671+
self,
672+
field_name: typing_extensions.Literal[
673+
"is_local", b"is_local", "result", b"result", "seq", b"seq"
674+
],
651675
) -> None: ...
652676

653677
global___ResolveActivity = ResolveActivity

temporalio/bridge/sdk-core

temporalio/service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import temporalio.exceptions
2727
import temporalio.runtime
2828

29-
__version__ = "1.7.0"
29+
__version__ = "1.7.1"
3030

3131
ServiceRequest = TypeVar("ServiceRequest", bound=google.protobuf.message.Message)
3232
ServiceResponse = TypeVar("ServiceResponse", bound=google.protobuf.message.Message)

0 commit comments

Comments
 (0)