@temporalio/core-bridge 1.13.2 → 1.14.0
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 +135 -100
- package/Cargo.toml +3 -2
- package/{sdk-core/fsm/rustfsm_trait/LICENSE.txt → LICENSE} +5 -5
- package/README.md +0 -1
- package/bridge-macros/Cargo.toml +16 -0
- package/bridge-macros/src/derive_js_function.rs +126 -0
- package/bridge-macros/src/derive_tryfromjs.rs +138 -0
- package/bridge-macros/src/derive_tryintojs.rs +151 -0
- package/bridge-macros/src/lib.rs +42 -0
- package/lib/native.d.ts +13 -6
- package/package.json +6 -5
- package/releases/aarch64-apple-darwin/index.node +0 -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
- package/sdk-core/.cargo/config.toml +9 -3
- package/sdk-core/.github/workflows/per-pr.yml +42 -5
- package/sdk-core/AGENTS.md +17 -19
- package/sdk-core/Cargo.toml +6 -7
- package/sdk-core/README.md +12 -15
- package/sdk-core/arch_docs/diagrams/deps.svg +102 -0
- package/sdk-core/{client → crates/client}/Cargo.toml +7 -9
- package/sdk-core/{client → crates/client}/src/lib.rs +110 -159
- package/sdk-core/{client → crates/client}/src/metrics.rs +1 -1
- package/sdk-core/{client → crates/client}/src/raw.rs +73 -44
- package/sdk-core/crates/client/src/request_extensions.rs +40 -0
- package/sdk-core/{client → crates/client}/src/retry.rs +24 -17
- package/sdk-core/crates/client/src/worker/mod.rs +1468 -0
- package/sdk-core/{client → crates/client}/src/workflow_handle/mod.rs +4 -4
- package/sdk-core/{core-api → crates/common}/Cargo.toml +17 -8
- package/sdk-core/crates/common/protos/api_cloud_upstream/VERSION +1 -0
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/account/v1/message.proto +18 -0
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +38 -11
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +21 -4
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +6 -6
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/sink/v1/message.proto +22 -0
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/create-release.yml +5 -0
- package/sdk-core/{core-api → crates/common}/src/envconfig.rs +2 -2
- package/sdk-core/{core-api → crates/common}/src/errors.rs +8 -1
- package/sdk-core/{fsm/rustfsm_trait/src/lib.rs → crates/common/src/fsm_trait.rs} +1 -27
- package/sdk-core/{core-api → crates/common}/src/lib.rs +24 -9
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/canned_histories.rs +1 -1
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/history_builder.rs +1 -1
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/history_info.rs +2 -2
- package/sdk-core/{sdk-core-protos/src/lib.rs → crates/common/src/protos/mod.rs} +18 -17
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/test_utils.rs +1 -1
- package/sdk-core/{core-api → crates/common}/src/telemetry/metrics.rs +447 -50
- package/sdk-core/{core-api → crates/common}/src/telemetry.rs +3 -1
- package/sdk-core/{core-api → crates/common}/src/worker.rs +112 -18
- package/sdk-core/crates/common/tests/worker_task_types_test.rs +129 -0
- package/sdk-core/crates/macros/Cargo.toml +23 -0
- package/sdk-core/{fsm/rustfsm_procmacro → crates/macros}/src/lib.rs +6 -11
- package/sdk-core/{sdk → crates/sdk}/Cargo.toml +10 -10
- package/sdk-core/{sdk → crates/sdk}/src/activity_context.rs +8 -6
- package/sdk-core/{sdk → crates/sdk}/src/interceptors.rs +1 -1
- package/sdk-core/{sdk → crates/sdk}/src/lib.rs +42 -37
- package/sdk-core/{sdk → crates/sdk}/src/workflow_context/options.rs +2 -2
- package/sdk-core/{sdk → crates/sdk}/src/workflow_context.rs +21 -19
- package/sdk-core/{sdk → crates/sdk}/src/workflow_future.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/Cargo.toml +32 -25
- package/sdk-core/{tests → crates/sdk-core/benches}/workflow_replay_bench.rs +10 -10
- package/sdk-core/crates/sdk-core/machine_coverage/ActivityMachine_Coverage.puml +32 -0
- package/sdk-core/crates/sdk-core/machine_coverage/CancelExternalMachine_Coverage.puml +9 -0
- package/sdk-core/crates/sdk-core/machine_coverage/CancelWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/ChildWorkflowMachine_Coverage.puml +27 -0
- package/sdk-core/crates/sdk-core/machine_coverage/CompleteWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/ContinueAsNewWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/FailWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/LocalActivityMachine_Coverage.puml +23 -0
- package/sdk-core/crates/sdk-core/machine_coverage/ModifyWorkflowPropertiesMachine_Coverage.puml +5 -0
- package/sdk-core/crates/sdk-core/machine_coverage/PatchMachine_Coverage.puml +8 -0
- package/sdk-core/crates/sdk-core/machine_coverage/SignalExternalMachine_Coverage.puml +12 -0
- package/sdk-core/crates/sdk-core/machine_coverage/TimerMachine_Coverage.puml +13 -0
- package/sdk-core/crates/sdk-core/machine_coverage/UpdateMachine_Coverage.puml +19 -0
- package/sdk-core/crates/sdk-core/machine_coverage/UpsertSearchAttributesMachine_Coverage.puml +5 -0
- package/sdk-core/crates/sdk-core/machine_coverage/WorkflowTaskMachine_Coverage.puml +11 -0
- package/sdk-core/{core → crates/sdk-core}/src/abstractions.rs +62 -6
- package/sdk-core/crates/sdk-core/src/antithesis.rs +60 -0
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/activity_tasks.rs +36 -31
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/mod.rs +12 -9
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/queries.rs +24 -21
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/replay_flag.rs +10 -8
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/updates.rs +17 -15
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/workers.rs +242 -17
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/workflow_cancels.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/workflow_tasks.rs +126 -39
- package/sdk-core/{core → crates/sdk-core}/src/debug_client.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/ephemeral_server/mod.rs +3 -3
- package/sdk-core/crates/sdk-core/src/histfetch.rs +33 -0
- package/sdk-core/{core → crates/sdk-core}/src/internal_flags.rs +4 -3
- package/sdk-core/{core → crates/sdk-core}/src/lib.rs +85 -43
- package/sdk-core/{core → crates/sdk-core}/src/pollers/mod.rs +8 -6
- package/sdk-core/{core → crates/sdk-core}/src/pollers/poll_buffer.rs +51 -16
- package/sdk-core/{core → crates/sdk-core}/src/protosext/mod.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/protosext/protocol_messages.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/replay/mod.rs +14 -11
- package/sdk-core/{core → crates/sdk-core}/src/retry_logic.rs +19 -1
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/log_export.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/metrics.rs +80 -34
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/mod.rs +4 -4
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/otel.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/prometheus_meter.rs +13 -13
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/prometheus_server.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/test_help/integ_helpers.rs +127 -40
- package/sdk-core/{core → crates/sdk-core}/src/test_help/unit_helpers.rs +13 -11
- package/sdk-core/{core → crates/sdk-core}/src/worker/activities/activity_heartbeat_manager.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/activities/local_activities.rs +14 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/activities.rs +21 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/client/mocks.rs +25 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/client.rs +164 -71
- package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +246 -0
- package/sdk-core/crates/sdk-core/src/worker/mod.rs +1462 -0
- package/sdk-core/{core → crates/sdk-core}/src/worker/nexus.rs +15 -14
- package/sdk-core/{core → crates/sdk-core}/src/worker/slot_provider.rs +12 -13
- package/sdk-core/{core → crates/sdk-core}/src/worker/tuner/fixed_size.rs +5 -1
- package/sdk-core/{core → crates/sdk-core}/src/worker/tuner/resource_based.rs +453 -57
- package/sdk-core/{core → crates/sdk-core}/src/worker/tuner.rs +21 -4
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/driven_workflow.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/history_update.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/activity_state_machine.rs +147 -37
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_external_state_machine.rs +8 -9
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_nexus_op_state_machine.rs +14 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_workflow_state_machine.rs +6 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/child_workflow_state_machine.rs +31 -37
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/complete_workflow_state_machine.rs +13 -8
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +6 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/fail_workflow_state_machine.rs +6 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/local_activity_state_machine.rs +33 -30
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/mod.rs +22 -17
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +4 -3
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/nexus_operation_state_machine.rs +20 -22
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/patch_state_machine.rs +12 -11
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/signal_external_state_machine.rs +9 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/timer_state_machine.rs +26 -13
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/transition_coverage.rs +1 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/update_state_machine.rs +19 -13
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +20 -18
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_machines/local_acts.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_machines.rs +61 -70
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_task_state_machine.rs +13 -15
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/managed_run.rs +55 -37
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/mod.rs +166 -60
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/run_cache.rs +10 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/wft_extraction.rs +4 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/wft_poller.rs +15 -4
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/workflow_stream.rs +30 -16
- package/sdk-core/{tests → crates/sdk-core/tests}/c_bridge_smoke_test.c +1 -1
- package/sdk-core/{tests → crates/sdk-core/tests}/cloud_tests.rs +1 -1
- package/sdk-core/crates/sdk-core/tests/common/fake_grpc_server.rs +106 -0
- package/sdk-core/{tests → crates/sdk-core/tests}/common/http_proxy.rs +1 -1
- package/sdk-core/{tests → crates/sdk-core/tests}/common/mod.rs +93 -74
- package/sdk-core/{tests → crates/sdk-core/tests}/common/workflows.rs +4 -3
- package/sdk-core/crates/sdk-core/tests/fsm_procmacro.rs +6 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/dupe_transitions_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/dupe_transitions_fail.stderr +12 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/dynamic_dest_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/forgot_name_fail.rs +1 -3
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/forgot_name_fail.stderr +4 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/handler_arg_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/handler_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/medium_complex_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/no_handle_conversions_require_into_fail.rs +2 -4
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/no_handle_conversions_require_into_fail.stderr +15 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/simple_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/struct_event_variant_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/struct_event_variant_fail.stderr +5 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/tuple_more_item_event_variant_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/tuple_more_item_event_variant_fail.stderr +5 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/tuple_zero_item_event_variant_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/tuple_zero_item_event_variant_fail.stderr +5 -0
- package/sdk-core/{tests → crates/sdk-core/tests}/global_metric_tests.rs +14 -15
- package/sdk-core/{tests → crates/sdk-core/tests/heavy_tests}/fuzzy_workflow.rs +3 -3
- package/sdk-core/{tests → crates/sdk-core/tests}/heavy_tests.rs +19 -12
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/activity_functions.rs +1 -1
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/client_tests.rs +16 -111
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/ephemeral_server_tests.rs +5 -6
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/heartbeat_tests.rs +23 -19
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/metrics_tests.rs +134 -60
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/pagination_tests.rs +4 -4
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/polling_tests.rs +37 -36
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/queries_tests.rs +12 -10
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/update_tests.rs +41 -29
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/visibility_tests.rs +24 -19
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs +1061 -0
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/worker_tests.rs +113 -51
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/worker_versioning_tests.rs +19 -17
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/activities.rs +35 -30
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/appdata_propagation.rs +3 -3
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/cancel_external.rs +14 -9
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/cancel_wf.rs +13 -8
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/child_workflows.rs +48 -35
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/continue_as_new.rs +14 -9
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/determinism.rs +24 -15
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/eager.rs +9 -4
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/local_activities.rs +47 -47
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/modify_wf_properties.rs +16 -11
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/nexus.rs +51 -23
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/patches.rs +22 -10
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/replay.rs +19 -17
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/resets.rs +14 -5
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/signals.rs +24 -15
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/stickyness.rs +8 -6
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/timers.rs +28 -18
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/upsert_search_attrs.rs +18 -13
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests.rs +46 -41
- package/sdk-core/{tests → crates/sdk-core/tests}/main.rs +15 -9
- package/sdk-core/{tests → crates/sdk-core/tests}/manual_tests.rs +20 -14
- package/sdk-core/{tests → crates/sdk-core/tests}/runner.rs +2 -2
- package/sdk-core/{tests → crates/sdk-core/tests}/shared_tests/mod.rs +10 -5
- package/sdk-core/{tests → crates/sdk-core/tests}/shared_tests/priority.rs +5 -5
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/Cargo.toml +13 -10
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/include/temporal-sdk-core-c-bridge.h +32 -23
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/client.rs +55 -32
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/envconfig.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/lib.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/metric.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/runtime.rs +24 -9
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/testing.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/context.rs +11 -10
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/mod.rs +7 -7
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/utils.rs +3 -4
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/worker.rs +111 -58
- package/sdk-core/docker-cgroup-tests.sh +24 -0
- package/sdk-core/{docker → etc/docker}/docker-compose-ci.yaml +9 -9
- package/sdk-core/{docker → etc/docker}/docker-compose-telem.yaml +11 -11
- package/sdk-core/{docker → etc/docker}/docker-compose.yaml +8 -8
- package/sdk-core/{integ-with-otel.sh → etc/integ-with-otel.sh} +1 -1
- package/sdk-core/etc/regen-depgraph.sh +2 -2
- package/src/client.rs +24 -33
- package/src/helpers/try_from_js.rs +1 -1
- package/src/logs.rs +1 -1
- package/src/metrics.rs +3 -3
- package/src/runtime.rs +42 -28
- package/src/testing.rs +3 -3
- package/src/worker.rs +70 -36
- package/ts/native.ts +13 -6
- package/LICENSE.md +0 -23
- package/sdk-core/client/src/worker_registry/mod.rs +0 -282
- package/sdk-core/core/src/worker/heartbeat.rs +0 -230
- package/sdk-core/core/src/worker/mod.rs +0 -990
- package/sdk-core/etc/deps.svg +0 -162
- package/sdk-core/fsm/Cargo.toml +0 -21
- package/sdk-core/fsm/README.md +0 -3
- package/sdk-core/fsm/rustfsm_procmacro/Cargo.toml +0 -27
- package/sdk-core/fsm/rustfsm_procmacro/LICENSE.txt +0 -21
- package/sdk-core/fsm/rustfsm_procmacro/tests/progress.rs +0 -8
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/dupe_transitions_fail.stderr +0 -12
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +0 -15
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/struct_event_variant_fail.stderr +0 -5
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_more_item_event_variant_fail.stderr +0 -5
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_zero_item_event_variant_fail.stderr +0 -5
- package/sdk-core/fsm/rustfsm_trait/Cargo.toml +0 -14
- package/sdk-core/fsm/src/lib.rs +0 -2
- package/sdk-core/sdk-core-protos/Cargo.toml +0 -37
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +0 -1
- /package/sdk-core/{client → crates/client}/src/callback_based.rs +0 -0
- /package/sdk-core/{client → crates/client}/src/proxy.rs +0 -0
- /package/sdk-core/{client → crates/client}/src/replaceable.rs +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/build.rs +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/.github/workflows/build.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/.github/workflows/push-to-buf.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/CODEOWNERS +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/LICENSE +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/Makefile +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/README.md +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.gen.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.lock +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/connectivityrule/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/nexus/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/region/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/resource/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/usage/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/CODEOWNERS +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/ci.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/publish-docs.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/push-to-buf.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-delete-release.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-publish-release.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-update.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/LICENSE +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/Makefile +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/README.md +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/api-linter.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.gen.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.lock +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/api/annotations.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/api/http.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/any.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/descriptor.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/duration.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/empty.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/struct.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/timestamp.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/wrappers.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/openapiv2.json +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/openapiv3.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/payload_description.txt +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/activity/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/batch/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/command/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/common/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/deployment/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/command_type.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/common.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/deployment.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/event_type.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/namespace.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/nexus.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/query.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/reset.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/schedule.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/update.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/workflow.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/errordetails/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/export/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/failure/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/filter/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/history/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/namespace/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/nexus/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/protocol/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/query/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/replication/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/rules/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/schedule/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/enhanced_stack_trace.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/user_metadata.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/worker_config.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/update/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/version/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/worker/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflow/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/google/rpc/status.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/grpc/health/v1/health.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/activity_result/activity_result.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/activity_task/activity_task.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/child_workflow/child_workflow.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/common/common.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/core_interface.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/external_data/external_data.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/nexus/nexus.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/Makefile +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/api-linter.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/buf.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto +0 -0
- /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/constants.rs +0 -0
- /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/task_token.rs +0 -0
- /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/utilities.rs +0 -0
- /package/sdk-core/{fsm → crates/macros}/LICENSE.txt +0 -0
- /package/sdk-core/{sdk → crates/sdk}/src/app_data.rs +0 -0
- /package/sdk-core/{core → crates/sdk-core}/src/abstractions/take_cell.rs +0 -0
- /package/sdk-core/{core → crates/sdk-core}/src/test_help/mod.rs +0 -0
- /package/sdk-core/{core → crates/sdk-core}/src/worker/slot_supplier.rs +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/ends_empty_wft_complete.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-16_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-23_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-85_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/fail_wf_task.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-0_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-1_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-2_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-3_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/old_change_marker_format.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/timer_workflow_history.bin +0 -0
- /package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/priority.rs +0 -0
- /package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/build.rs +0 -0
- /package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/random.rs +0 -0
- /package/sdk-core/{cargo-tokio-console.sh → etc/cargo-tokio-console.sh} +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
use super::{MachineError, StateMachine, TransitionResult, fsm};
|
|
1
2
|
use crate::worker::workflow::{
|
|
2
3
|
WFMachinesError,
|
|
3
4
|
machines::{
|
|
4
5
|
EventInfo, HistEventData, NewMachineWithCommand, OnEventWrapper, WFMachinesAdapter,
|
|
5
6
|
workflow_machines::MachineResponse,
|
|
6
7
|
},
|
|
8
|
+
nondeterminism,
|
|
7
9
|
};
|
|
8
10
|
use itertools::Itertools;
|
|
9
|
-
use
|
|
10
|
-
use temporal_sdk_core_protos::{
|
|
11
|
+
use temporalio_common::protos::{
|
|
11
12
|
coresdk::{
|
|
12
13
|
nexus::{NexusOperationCancellationType, NexusOperationResult, nexus_operation_result},
|
|
13
14
|
workflow_activation::{
|
|
@@ -392,10 +393,9 @@ pub(super) struct TimedOut;
|
|
|
392
393
|
pub(super) struct Cancelled;
|
|
393
394
|
|
|
394
395
|
fn completion_of_not_abandoned_err() -> WFMachinesError {
|
|
395
|
-
|
|
396
|
+
nondeterminism!(
|
|
396
397
|
"Nexus operation which don't have the ABANDON cancellation type cannot complete after \
|
|
397
398
|
being cancelled."
|
|
398
|
-
.to_string(),
|
|
399
399
|
)
|
|
400
400
|
}
|
|
401
401
|
|
|
@@ -455,8 +455,8 @@ impl TryFrom<HistEventData> for NexusOperationMachineEvents {
|
|
|
455
455
|
event_id: e.event_id,
|
|
456
456
|
})
|
|
457
457
|
} else {
|
|
458
|
-
return Err(
|
|
459
|
-
"NexusOperationScheduled attributes were unset or malformed"
|
|
458
|
+
return Err(nondeterminism!(
|
|
459
|
+
"NexusOperationScheduled attributes were unset or malformed"
|
|
460
460
|
));
|
|
461
461
|
}
|
|
462
462
|
}
|
|
@@ -466,8 +466,8 @@ impl TryFrom<HistEventData> for NexusOperationMachineEvents {
|
|
|
466
466
|
{
|
|
467
467
|
Self::NexusOperationStarted(sa)
|
|
468
468
|
} else {
|
|
469
|
-
return Err(
|
|
470
|
-
"NexusOperationStarted attributes were unset or malformed"
|
|
469
|
+
return Err(nondeterminism!(
|
|
470
|
+
"NexusOperationStarted attributes were unset or malformed"
|
|
471
471
|
));
|
|
472
472
|
}
|
|
473
473
|
}
|
|
@@ -477,8 +477,8 @@ impl TryFrom<HistEventData> for NexusOperationMachineEvents {
|
|
|
477
477
|
{
|
|
478
478
|
Self::NexusOperationCompleted(ca)
|
|
479
479
|
} else {
|
|
480
|
-
return Err(
|
|
481
|
-
"NexusOperationCompleted attributes were unset or malformed"
|
|
480
|
+
return Err(nondeterminism!(
|
|
481
|
+
"NexusOperationCompleted attributes were unset or malformed"
|
|
482
482
|
));
|
|
483
483
|
}
|
|
484
484
|
}
|
|
@@ -488,8 +488,8 @@ impl TryFrom<HistEventData> for NexusOperationMachineEvents {
|
|
|
488
488
|
{
|
|
489
489
|
Self::NexusOperationFailed(fa)
|
|
490
490
|
} else {
|
|
491
|
-
return Err(
|
|
492
|
-
"NexusOperationFailed attributes were unset or malformed"
|
|
491
|
+
return Err(nondeterminism!(
|
|
492
|
+
"NexusOperationFailed attributes were unset or malformed"
|
|
493
493
|
));
|
|
494
494
|
}
|
|
495
495
|
}
|
|
@@ -499,8 +499,8 @@ impl TryFrom<HistEventData> for NexusOperationMachineEvents {
|
|
|
499
499
|
{
|
|
500
500
|
Self::NexusOperationCanceled(ca)
|
|
501
501
|
} else {
|
|
502
|
-
return Err(
|
|
503
|
-
"NexusOperationCanceled attributes were unset or malformed"
|
|
502
|
+
return Err(nondeterminism!(
|
|
503
|
+
"NexusOperationCanceled attributes were unset or malformed"
|
|
504
504
|
));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
@@ -510,8 +510,8 @@ impl TryFrom<HistEventData> for NexusOperationMachineEvents {
|
|
|
510
510
|
{
|
|
511
511
|
Self::NexusOperationTimedOut(toa)
|
|
512
512
|
} else {
|
|
513
|
-
return Err(
|
|
514
|
-
"NexusOperationTimedOut attributes were unset or malformed"
|
|
513
|
+
return Err(nondeterminism!(
|
|
514
|
+
"NexusOperationTimedOut attributes were unset or malformed"
|
|
515
515
|
));
|
|
516
516
|
}
|
|
517
517
|
}
|
|
@@ -525,9 +525,8 @@ impl TryFrom<HistEventData> for NexusOperationMachineEvents {
|
|
|
525
525
|
{
|
|
526
526
|
Self::NexusOperationCancelRequestCompleted(attrs)
|
|
527
527
|
} else {
|
|
528
|
-
return Err(
|
|
528
|
+
return Err(nondeterminism!(
|
|
529
529
|
"NexusOperationCancelRequestCompleted attributes were unset or malformed"
|
|
530
|
-
.to_string(),
|
|
531
530
|
));
|
|
532
531
|
}
|
|
533
532
|
}
|
|
@@ -540,16 +539,15 @@ impl TryFrom<HistEventData> for NexusOperationMachineEvents {
|
|
|
540
539
|
{
|
|
541
540
|
Self::NexusOperationCancelRequestFailed(attrs)
|
|
542
541
|
} else {
|
|
543
|
-
return Err(
|
|
542
|
+
return Err(nondeterminism!(
|
|
544
543
|
"NexusOperationCancelRequestFailed attributes were unset or malformed"
|
|
545
|
-
.to_string(),
|
|
546
544
|
));
|
|
547
545
|
}
|
|
548
546
|
}
|
|
549
547
|
_ => {
|
|
550
|
-
return Err(
|
|
548
|
+
return Err(nondeterminism!(
|
|
551
549
|
"Nexus operation machine does not handle this event: {e:?}"
|
|
552
|
-
))
|
|
550
|
+
));
|
|
553
551
|
}
|
|
554
552
|
})
|
|
555
553
|
}
|
package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/patch_state_machine.rs
RENAMED
|
@@ -18,26 +18,26 @@
|
|
|
18
18
|
//! | replaying, no marker | deprecate_patch | Call allowed |
|
|
19
19
|
|
|
20
20
|
use super::{
|
|
21
|
-
EventInfo, NewMachineWithCommand, OnEventWrapper,
|
|
22
|
-
workflow_machines::MachineResponse,
|
|
21
|
+
EventInfo, NewMachineWithCommand, OnEventWrapper, StateMachine, TransitionResult,
|
|
22
|
+
WFMachinesAdapter, WFMachinesError, fsm, workflow_machines::MachineResponse,
|
|
23
23
|
};
|
|
24
24
|
use crate::{
|
|
25
25
|
internal_flags::CoreInternalFlags,
|
|
26
26
|
protosext::HistoryEventExt,
|
|
27
27
|
worker::workflow::{
|
|
28
|
-
InternalFlagsRef,
|
|
28
|
+
InternalFlagsRef, fatal,
|
|
29
29
|
machines::{
|
|
30
30
|
HistEventData, upsert_search_attributes_state_machine::MAX_SEARCH_ATTR_PAYLOAD_SIZE,
|
|
31
31
|
},
|
|
32
|
+
nondeterminism,
|
|
32
33
|
},
|
|
33
34
|
};
|
|
34
35
|
use anyhow::Context;
|
|
35
|
-
use rustfsm::{StateMachine, TransitionResult, fsm};
|
|
36
36
|
use std::{
|
|
37
37
|
collections::{BTreeSet, HashMap},
|
|
38
38
|
convert::TryFrom,
|
|
39
39
|
};
|
|
40
|
-
use
|
|
40
|
+
use temporalio_common::protos::{
|
|
41
41
|
VERSION_SEARCH_ATTR_KEY,
|
|
42
42
|
constants::PATCH_MARKER_NAME,
|
|
43
43
|
coresdk::{AsJsonPayloadExt, common::build_has_change_marker_details},
|
|
@@ -130,7 +130,7 @@ pub(super) fn has_change<'a>(
|
|
|
130
130
|
let mut serialized = all_ids
|
|
131
131
|
.as_json_payload()
|
|
132
132
|
.context("Could not serialize search attribute value for patch machine")
|
|
133
|
-
.map_err(|e|
|
|
133
|
+
.map_err(|e| fatal!("{}", e))?;
|
|
134
134
|
|
|
135
135
|
if serialized.data.len() >= MAX_SEARCH_ATTR_PAYLOAD_SIZE {
|
|
136
136
|
warn!(
|
|
@@ -220,10 +220,11 @@ impl Notified {
|
|
|
220
220
|
id: String,
|
|
221
221
|
) -> PatchMachineTransition<MarkerCommandRecorded> {
|
|
222
222
|
if id != dat.patch_id {
|
|
223
|
-
return TransitionResult::Err(
|
|
223
|
+
return TransitionResult::Err(nondeterminism!(
|
|
224
224
|
"Change id {} does not match expected id {}",
|
|
225
|
-
id,
|
|
226
|
-
|
|
225
|
+
id,
|
|
226
|
+
dat.patch_id
|
|
227
|
+
));
|
|
227
228
|
}
|
|
228
229
|
TransitionResult::default()
|
|
229
230
|
}
|
|
@@ -257,9 +258,9 @@ impl TryFrom<HistEventData> for PatchMachineEvents {
|
|
|
257
258
|
let e = e.event;
|
|
258
259
|
match e.get_patch_marker_details() {
|
|
259
260
|
Some((id, _)) => Ok(Self::MarkerRecorded(id)),
|
|
260
|
-
_ => Err(
|
|
261
|
+
_ => Err(nondeterminism!(
|
|
261
262
|
"Change machine cannot handle this event: {e}"
|
|
262
|
-
))
|
|
263
|
+
)),
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
266
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
use super::{
|
|
2
|
-
EventInfo, NewMachineWithCommand, OnEventWrapper,
|
|
3
|
-
workflow_machines::MachineResponse,
|
|
2
|
+
EventInfo, MachineError, NewMachineWithCommand, OnEventWrapper, StateMachine, TransitionResult,
|
|
3
|
+
WFMachinesAdapter, WFMachinesError, fsm, workflow_machines::MachineResponse,
|
|
4
4
|
};
|
|
5
|
-
use crate::worker::workflow::machines::HistEventData;
|
|
6
|
-
use rustfsm::{MachineError, StateMachine, TransitionResult, fsm};
|
|
5
|
+
use crate::worker::workflow::{fatal, machines::HistEventData, nondeterminism};
|
|
7
6
|
use std::convert::TryFrom;
|
|
8
|
-
use
|
|
7
|
+
use temporalio_common::protos::{
|
|
9
8
|
coresdk::{
|
|
10
9
|
IntoPayloadsExt,
|
|
11
10
|
common::NamespacedWorkflowExecution,
|
|
@@ -71,8 +70,8 @@ pub(super) fn new_external_signal(
|
|
|
71
70
|
) -> Result<NewMachineWithCommand, WFMachinesError> {
|
|
72
71
|
let (workflow_execution, only_child) = match attrs.target {
|
|
73
72
|
None => {
|
|
74
|
-
return Err(
|
|
75
|
-
"Signal external workflow command had empty target field"
|
|
73
|
+
return Err(fatal!(
|
|
74
|
+
"Signal external workflow command had empty target field"
|
|
76
75
|
));
|
|
77
76
|
}
|
|
78
77
|
Some(sig_we::Target::ChildWorkflowId(wfid)) => (
|
|
@@ -196,15 +195,13 @@ impl TryFrom<HistEventData> for SignalExternalMachineEvents {
|
|
|
196
195
|
{
|
|
197
196
|
Self::SignalExternalWorkflowExecutionFailed(attrs.cause())
|
|
198
197
|
} else {
|
|
199
|
-
return Err(
|
|
200
|
-
"Signal workflow failed attributes were unset: {e}"
|
|
201
|
-
)));
|
|
198
|
+
return Err(fatal!("Signal workflow failed attributes were unset: {e}"));
|
|
202
199
|
}
|
|
203
200
|
}
|
|
204
201
|
_ => {
|
|
205
|
-
return Err(
|
|
202
|
+
return Err(nondeterminism!(
|
|
206
203
|
"Signal external WF machine does not handle this event: {e}"
|
|
207
|
-
))
|
|
204
|
+
));
|
|
208
205
|
}
|
|
209
206
|
})
|
|
210
207
|
}
|
package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/timer_state_machine.rs
RENAMED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
#![allow(clippy::large_enum_variant)]
|
|
2
2
|
|
|
3
3
|
use super::{
|
|
4
|
-
EventInfo, NewMachineWithCommand, OnEventWrapper,
|
|
5
|
-
workflow_machines::MachineResponse,
|
|
4
|
+
EventInfo, MachineError, NewMachineWithCommand, OnEventWrapper, StateMachine, TransitionResult,
|
|
5
|
+
WFMachinesAdapter, fsm, workflow_machines::MachineResponse,
|
|
6
6
|
};
|
|
7
|
-
use crate::worker::workflow::{WFMachinesError, machines::HistEventData};
|
|
8
|
-
use rustfsm::{MachineError, StateMachine, TransitionResult, fsm};
|
|
7
|
+
use crate::worker::workflow::{WFMachinesError, fatal, machines::HistEventData, nondeterminism};
|
|
9
8
|
use std::convert::TryFrom;
|
|
10
|
-
use
|
|
9
|
+
use temporalio_common::protos::{
|
|
11
10
|
coresdk::{
|
|
12
11
|
HistoryEventId,
|
|
13
12
|
workflow_activation::FireTimer,
|
|
@@ -121,15 +120,13 @@ impl TryFrom<HistEventData> for TimerMachineEvents {
|
|
|
121
120
|
{
|
|
122
121
|
Self::TimerFired(attrs)
|
|
123
122
|
} else {
|
|
124
|
-
return Err(
|
|
125
|
-
"Timer fired attribs were unset: {e}"
|
|
126
|
-
)));
|
|
123
|
+
return Err(fatal!("Timer fired attribs were unset: {e}"));
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
126
|
_ => {
|
|
130
|
-
return Err(
|
|
127
|
+
return Err(nondeterminism!(
|
|
131
128
|
"Timer machine does not handle this event: {e}"
|
|
132
|
-
))
|
|
129
|
+
));
|
|
133
130
|
}
|
|
134
131
|
})
|
|
135
132
|
}
|
|
@@ -193,6 +190,14 @@ impl StartCommandCreated {
|
|
|
193
190
|
|
|
194
191
|
pub(super) fn on_cancel(self, dat: &mut SharedState) -> TimerMachineTransition<Canceled> {
|
|
195
192
|
dat.cancelled_before_sent = true;
|
|
193
|
+
|
|
194
|
+
#[cfg(feature = "antithesis_assertions")]
|
|
195
|
+
crate::antithesis::assert_sometimes!(
|
|
196
|
+
true,
|
|
197
|
+
"Timer cancelled before sent to server",
|
|
198
|
+
::serde_json::json!({"timer_seq": dat.attrs.seq})
|
|
199
|
+
);
|
|
200
|
+
|
|
196
201
|
TransitionResult::default()
|
|
197
202
|
}
|
|
198
203
|
}
|
|
@@ -209,10 +214,11 @@ impl StartCommandRecorded {
|
|
|
209
214
|
if dat.attrs.seq.to_string() == attrs.timer_id {
|
|
210
215
|
TransitionResult::ok(vec![TimerMachineCommand::Complete], Fired::default())
|
|
211
216
|
} else {
|
|
212
|
-
TransitionResult::Err(
|
|
217
|
+
TransitionResult::Err(nondeterminism!(
|
|
213
218
|
"Timer fired event did not have expected timer id {}, it was {}!",
|
|
214
|
-
dat.attrs.seq,
|
|
215
|
-
|
|
219
|
+
dat.attrs.seq,
|
|
220
|
+
attrs.timer_id
|
|
221
|
+
))
|
|
216
222
|
}
|
|
217
223
|
}
|
|
218
224
|
|
|
@@ -220,6 +226,13 @@ impl StartCommandRecorded {
|
|
|
220
226
|
self,
|
|
221
227
|
dat: &mut SharedState,
|
|
222
228
|
) -> TimerMachineTransition<CancelTimerCommandCreated> {
|
|
229
|
+
#[cfg(feature = "antithesis_assertions")]
|
|
230
|
+
crate::antithesis::assert_sometimes!(
|
|
231
|
+
true,
|
|
232
|
+
"Timer cancelled after started",
|
|
233
|
+
::serde_json::json!({"timer_seq": dat.attrs.seq})
|
|
234
|
+
);
|
|
235
|
+
|
|
223
236
|
TransitionResult::ok(
|
|
224
237
|
vec![TimerMachineCommand::IssueCancelCmd(
|
|
225
238
|
CancelTimer { seq: dat.attrs.seq }.into(),
|
package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/transition_coverage.rs
RENAMED
|
@@ -71,7 +71,7 @@ fn spawn_save_coverage_at_end() -> SyncSender<(String, CoveredTransition)> {
|
|
|
71
71
|
mod machine_coverage_report {
|
|
72
72
|
use super::*;
|
|
73
73
|
use crate::worker::workflow::machines::{
|
|
74
|
-
activity_state_machine::ActivityMachine,
|
|
74
|
+
StateMachine, activity_state_machine::ActivityMachine,
|
|
75
75
|
cancel_external_state_machine::CancelExternalMachine,
|
|
76
76
|
cancel_workflow_state_machine::CancelWorkflowMachine,
|
|
77
77
|
child_workflow_state_machine::ChildWorkflowMachine,
|
|
@@ -85,7 +85,6 @@ mod machine_coverage_report {
|
|
|
85
85
|
upsert_search_attributes_state_machine::UpsertSearchAttributesMachine,
|
|
86
86
|
workflow_task_state_machine::WorkflowTaskMachine,
|
|
87
87
|
};
|
|
88
|
-
use rustfsm::StateMachine;
|
|
89
88
|
use std::{fs::File, io::Write};
|
|
90
89
|
|
|
91
90
|
// This "test" needs to exist so that we have a way to join the spawned thread. Otherwise
|
package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/update_state_machine.rs
RENAMED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
use super::{
|
|
1
|
+
use super::{
|
|
2
|
+
EventInfo, MachineError, StateMachine, TransitionResult, WFMachinesAdapter, WFMachinesError,
|
|
3
|
+
fsm, workflow_machines::MachineResponse,
|
|
4
|
+
};
|
|
2
5
|
use crate::{
|
|
3
6
|
protosext::protocol_messages::UpdateRequest,
|
|
4
|
-
worker::workflow::
|
|
7
|
+
worker::workflow::{
|
|
8
|
+
fatal,
|
|
9
|
+
machines::{HistEventData, NewMachineWithResponse},
|
|
10
|
+
nondeterminism,
|
|
11
|
+
},
|
|
5
12
|
};
|
|
6
13
|
use itertools::Itertools;
|
|
7
14
|
use prost::EncodeError;
|
|
8
|
-
use rustfsm::{MachineError, StateMachine, TransitionResult, fsm};
|
|
9
15
|
use std::convert::TryFrom;
|
|
10
|
-
use
|
|
16
|
+
use temporalio_common::protos::{
|
|
11
17
|
coresdk::{
|
|
12
18
|
workflow_activation::DoUpdate,
|
|
13
19
|
workflow_commands::{UpdateResponse, update_response},
|
|
@@ -119,10 +125,10 @@ impl UpdateMachine {
|
|
|
119
125
|
) -> Result<Vec<MachineResponse>, WFMachinesError> {
|
|
120
126
|
let cmds = match resp.response {
|
|
121
127
|
None => {
|
|
122
|
-
return Err(
|
|
128
|
+
return Err(fatal!(
|
|
123
129
|
"Update response for update {} had an empty result, this is a lang layer bug.",
|
|
124
130
|
&self.shared_state.meta.update_id
|
|
125
|
-
))
|
|
131
|
+
));
|
|
126
132
|
}
|
|
127
133
|
Some(update_response::Response::Accepted(_)) => {
|
|
128
134
|
self.on_event(UpdateMachineEvents::Accept)
|
|
@@ -135,11 +141,11 @@ impl UpdateMachine {
|
|
|
135
141
|
}
|
|
136
142
|
}
|
|
137
143
|
.map_err(|e| match e {
|
|
138
|
-
MachineError::InvalidTransition =>
|
|
144
|
+
MachineError::InvalidTransition => nondeterminism!(
|
|
139
145
|
"Invalid transition while handling update response (id {}) in state {}",
|
|
140
146
|
&self.shared_state.meta.update_id,
|
|
141
147
|
self.state(),
|
|
142
|
-
)
|
|
148
|
+
),
|
|
143
149
|
MachineError::Underlying(e) => e,
|
|
144
150
|
})?;
|
|
145
151
|
cmds.into_iter()
|
|
@@ -172,9 +178,9 @@ impl UpdateMachine {
|
|
|
172
178
|
outgoing_id: String,
|
|
173
179
|
msg: UpdateMsg,
|
|
174
180
|
) -> Result<MachineResponse, WFMachinesError> {
|
|
175
|
-
let accept_body = msg
|
|
176
|
-
|
|
177
|
-
|
|
181
|
+
let accept_body = msg
|
|
182
|
+
.pack()
|
|
183
|
+
.map_err(|e| fatal!("Failed to serialize update response: {e:?}"))?;
|
|
178
184
|
Ok(MachineResponse::IssueNewMessage(ProtocolMessage {
|
|
179
185
|
id: outgoing_id.clone(),
|
|
180
186
|
protocol_instance_id: self.shared_state.instance_id.clone(),
|
|
@@ -221,9 +227,9 @@ impl TryFrom<HistEventData> for UpdateMachineEvents {
|
|
|
221
227
|
UpdateMachineEvents::WorkflowExecutionUpdateCompleted
|
|
222
228
|
}
|
|
223
229
|
_ => {
|
|
224
|
-
return Err(
|
|
230
|
+
return Err(nondeterminism!(
|
|
225
231
|
"Update machine does not handle this event: {e}"
|
|
226
|
-
))
|
|
232
|
+
));
|
|
227
233
|
}
|
|
228
234
|
})
|
|
229
235
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
use super::{
|
|
1
|
+
use super::{
|
|
2
|
+
NewMachineWithCommand, StateMachine, TransitionResult, fsm, workflow_machines::MachineResponse,
|
|
3
|
+
};
|
|
2
4
|
use crate::{
|
|
3
5
|
internal_flags::CoreInternalFlags,
|
|
4
6
|
worker::workflow::{
|
|
@@ -6,8 +8,7 @@ use crate::{
|
|
|
6
8
|
machines::{EventInfo, HistEventData, WFMachinesAdapter},
|
|
7
9
|
},
|
|
8
10
|
};
|
|
9
|
-
use
|
|
10
|
-
use temporal_sdk_core_protos::{
|
|
11
|
+
use temporalio_common::protos::{
|
|
11
12
|
VERSION_SEARCH_ATTR_KEY,
|
|
12
13
|
coresdk::workflow_commands::UpsertWorkflowSearchAttributes,
|
|
13
14
|
temporal::api::{
|
|
@@ -176,7 +177,7 @@ impl From<Created> for CommandIssued {
|
|
|
176
177
|
|
|
177
178
|
#[cfg(test)]
|
|
178
179
|
mod tests {
|
|
179
|
-
use super::{super::OnEventWrapper, *};
|
|
180
|
+
use super::{super::OnEventWrapper, StateMachine, *};
|
|
180
181
|
use crate::{
|
|
181
182
|
replay::TestHistoryBuilder,
|
|
182
183
|
test_help::{
|
|
@@ -184,21 +185,22 @@ mod tests {
|
|
|
184
185
|
},
|
|
185
186
|
worker::client::mocks::mock_worker_client,
|
|
186
187
|
};
|
|
187
|
-
use rustfsm::StateMachine;
|
|
188
188
|
use std::collections::HashMap;
|
|
189
|
-
use
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
189
|
+
use temporalio_common::{
|
|
190
|
+
Worker,
|
|
191
|
+
protos::{
|
|
192
|
+
coresdk::{
|
|
193
|
+
AsJsonPayloadExt,
|
|
194
|
+
workflow_activation::{WorkflowActivationJob, workflow_activation_job},
|
|
195
|
+
workflow_commands::SetPatchMarker,
|
|
196
|
+
workflow_completion::WorkflowActivationCompletion,
|
|
197
|
+
},
|
|
198
|
+
temporal::api::{
|
|
199
|
+
command::v1::command::Attributes,
|
|
200
|
+
common::v1::Payload,
|
|
201
|
+
enums::v1::EventType,
|
|
202
|
+
history::v1::{HistoryEvent, UpsertWorkflowSearchAttributesEventAttributes},
|
|
203
|
+
},
|
|
202
204
|
},
|
|
203
205
|
};
|
|
204
206
|
|
|
@@ -7,7 +7,7 @@ use std::{
|
|
|
7
7
|
collections::{HashMap, HashSet},
|
|
8
8
|
time::SystemTime,
|
|
9
9
|
};
|
|
10
|
-
use
|
|
10
|
+
use temporalio_common::protos::temporal::api::common::v1::WorkflowExecution;
|
|
11
11
|
|
|
12
12
|
#[derive(Default)]
|
|
13
13
|
pub(super) struct LocalActivityData {
|