durable-workflow 2.18.0__tar.gz → 2.19.1__tar.gz
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.
- {durable_workflow-2.18.0/src/durable_workflow.egg-info → durable_workflow-2.19.1}/PKG-INFO +1 -1
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/pyproject.toml +3 -3
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/__init__.py +2 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/client.py +27 -12
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/errors.py +36 -8
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/replay_clock.py +15 -1
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/workflow.py +203 -7
- {durable_workflow-2.18.0 → durable_workflow-2.19.1/src/durable_workflow.egg-info}/PKG-INFO +1 -1
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow.egg-info/SOURCES.txt +4 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_retry_cap_cell.py +1 -1
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_business_replay_clock.py +41 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_business_replay_clock_parallel.py +2 -2
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_child_workflow_policies.py +1 -4
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_client.py +58 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_command_keys_acceptance.py +3 -2
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_command_keys_workspace.py +65 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_parallel_group_policy.py +9 -4
- durable_workflow-2.19.1/tests/test_parallel_member_failure_open_siblings.py +346 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_parallel_saga_authoring.py +3 -5
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_physical_command_key_readback.py +8 -11
- durable_workflow-2.19.1/tests/test_quiesced_snapshot.py +154 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_replay.py +3 -3
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_replay_regression_corpus.py +52 -1
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_run_closed_settlement_replay.py +10 -7
- durable_workflow-2.19.1/tests/test_schedule_origin.py +167 -0
- durable_workflow-2.19.1/tests/test_synthetic_command_key_readback.py +171 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/LICENSE +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/README.md +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/setup.cfg +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_activity_checkpoint.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_activity_lease.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_activity_process.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_avro.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_cancellation_scope.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_cancellation_scope_history.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_condition_fingerprint.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_cooperative_cancellation.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_failure_reporting.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_metric_routes.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_poll_transport.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_prepared_local_activity.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_query_task_authority.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_sticky_workflow_cache.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/_typed_values.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/activity.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/auth_composition.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/cancellation.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/external_storage.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/external_task_input.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/external_task_result.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/history_bundle_verify.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/interceptors.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/invocable.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/metrics.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/nexus.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/py.typed +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/python_conformance.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/replay_clock_math.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/replay_conformance.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/replay_verify.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/retry_policy.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/serializer.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/server_compatibility.json +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/sync.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/telemetry.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/telemetry_carrier.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/testing.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/worker.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/worker_session.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/worker_status.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow/workflow_updates_conformance.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow.egg-info/dependency_links.txt +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow.egg-info/entry_points.txt +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow.egg-info/requires.txt +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow.egg-info/top_level.txt +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_acceptance_authority.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_acceptance_consumer.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_acceptance_entry.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_cancellation_policies.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_checkpoint.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_context.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_exponential_retry.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_heartbeat_authority.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_identity.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_install_inventory.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_lease_authority.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_lease_renewal.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_lease_worker.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_process.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_retry_info.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_activity_run_closed_refusal.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_auth_composition.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_avro_value_benchmark.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_avro_value_protocol.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_business_replay_clock_child.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_business_replay_clock_redrive.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_business_replay_clock_sequence_claims.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cancellation_cause.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cancellation_context.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cancellation_remaining_time.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cancellation_scope_admission.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cancellation_scope_authoring.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cancellation_scope_boundary.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cancellation_scope_opening.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_checkpointed_batch_example.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_ci_checkout.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_ci_integration_endpoint.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_client_iterators.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_client_telemetry.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_client_timeouts.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_codec_regression_corpus.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_command_keys_captured_inputs.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_command_keys_container_ownership.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_committed_cancellation_scope_descendants.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_committed_cancellation_scope_groups.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_committed_cancellation_scope_history.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_committed_cancellation_scope_replay.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_completion_size_limit.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_condition_fingerprint.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_condition_occurrence_id.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_condition_replay_drift.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_control_plane_parity_fixtures.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cooperative_cancellation.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cooperative_cancellation_client.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cooperative_cancellation_worker.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_cooperative_remote_worker.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_docs_release_channel.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_docstring_cross_references.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_durable_selection.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_empty_callback_failure.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_errors.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_external_storage.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_external_task_input.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_external_task_result.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_failure_reporting.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_generator_lifecycle.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_golden_history_replay.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_history_bundle_pruned.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_history_bundle_schema2.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_history_bundle_verify.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_history_event_contract.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_invocable.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_local_activity_backoff.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_local_failure_reporting.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_message_streams.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_metric_routes.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_metrics.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_native_timer_redrive_cell.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_native_timer_redrive_clock.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_nexus_durable_wait.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_nexus_namespace.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_nexus_wire.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_order_processing_example.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_parallel_completion_order_replay.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_patch_history.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_pending_operation_replay.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_poll_failure_backoff.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_poll_transport.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_portal_source_split.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_prepared_local_activity_client.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_prepared_local_activity_groups.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_prepared_local_activity_policies.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_prepared_local_activity_worker.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_public_boundary_scanner.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_publish_workflow_isolation.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_published_activity_acceptance.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_published_pagination_evidence.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_pypi_project_surface.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_python_conformance.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_queries.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_query_task_authority.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_query_timeout_retry.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_readme_quickstart.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_redrive_call_ledger.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_redrive_replay.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_redrive_successor_evidence.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_registration_ambiguity.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_release_metadata.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_release_promotion.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_replay_clock.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_replay_conformance.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_replay_verify.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_retry_cap_download.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_retry_cap_workflow.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_retry_policy.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_run_activities.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_run_cancellation_scope_replay.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_runtime_external_payload_transport.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_schedules.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_scoped_run_cancellation_context.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_sdk_metrics_contract.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_search_attribute_replay_identity.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_serializer.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_signals.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_sleep.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_standalone_activity_client.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_static_credential_validation.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_sticky_execution.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_sticky_history_suffix.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_storage_admission.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_sync.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_sync_activities.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_telemetry.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_telemetry_carrier.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_testing_failures.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_testing_harness.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_testing_nexus.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_threaded_heartbeat_example.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_tls_trust.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_transport_diagnostics.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_typed_values.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_typed_workflow_values.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_update_outcome.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_update_signal_condition_replay.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_updates.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_wait_condition.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker_deregistration.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker_observation.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker_session.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker_startup_buffered.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker_startup_raw.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker_startup_read_budget.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker_startup_snapshot.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker_status.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_worker_telemetry_wire.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_workflow_entry_arguments.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_workflow_entrypoint_validation.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_workflow_handler_validation.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_workflow_identity.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_workflow_result_timeout.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_workflow_streams.py +0 -0
- {durable_workflow-2.18.0 → durable_workflow-2.19.1}/tests/test_workflow_updates_conformance.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "durable-workflow"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.19.1"
|
|
8
8
|
description = "Python client and worker SDK for Durable Workflow Cloud and self-hosted Server"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -79,8 +79,8 @@ durable-workflow-replay-conformance = "durable_workflow.replay_conformance:main"
|
|
|
79
79
|
durable-workflow-workflow-updates-conformance = "durable_workflow.workflow_updates_conformance:main"
|
|
80
80
|
|
|
81
81
|
[tool.durable-workflow]
|
|
82
|
-
product-train = "2.
|
|
83
|
-
registry-version = "2.
|
|
82
|
+
product-train = "2.19.1"
|
|
83
|
+
registry-version = "2.19.1"
|
|
84
84
|
supported-server-versions = "2.8.0"
|
|
85
85
|
supported-server-release-baselines = { "2" = "2.8.0", "3" = "3.0.0" }
|
|
86
86
|
worker-protocol-version = "1.20"
|
|
@@ -250,6 +250,7 @@ from .workflow import (
|
|
|
250
250
|
Replayer,
|
|
251
251
|
ReplayOutcome,
|
|
252
252
|
Saga,
|
|
253
|
+
ScheduleOrigin,
|
|
253
254
|
SelectionResult,
|
|
254
255
|
StartChildWorkflow,
|
|
255
256
|
replay,
|
|
@@ -311,6 +312,7 @@ __all__ = [
|
|
|
311
312
|
"ScheduleList",
|
|
312
313
|
"ScheduleListError",
|
|
313
314
|
"ScheduleNotFound",
|
|
315
|
+
"ScheduleOrigin",
|
|
314
316
|
"ScheduleSpec",
|
|
315
317
|
"ScheduleTriggerResult",
|
|
316
318
|
"SearchAttributeList",
|
|
@@ -66,6 +66,7 @@ from ._poll_transport import warn_early_cutoff as _warn_poll_cutoff
|
|
|
66
66
|
from ._query_task_authority import QueryTaskAuthority, current_query_authority
|
|
67
67
|
from ._typed_values import decode_payload_value, to_payload_values, validate_annotation
|
|
68
68
|
from .errors import (
|
|
69
|
+
REQUEST_ID_AMBIGUOUS,
|
|
69
70
|
REQUEST_ID_CONFLICT,
|
|
70
71
|
ExternalPayloadIntegrityMismatch,
|
|
71
72
|
ExternalPayloadOversized,
|
|
@@ -276,7 +277,7 @@ def _command_request_id(request_id: str | None, command: str) -> str:
|
|
|
276
277
|
"""Return the caller command key for one logical signal or update call.
|
|
277
278
|
|
|
278
279
|
The key is the body field ``request_id`` (1-255 opaque, case-sensitive
|
|
279
|
-
|
|
280
|
+
Unicode characters). A caller-supplied key is sent verbatim; otherwise one
|
|
280
281
|
``sdk-python-<command>-<uuid4 hex>`` key is generated per logical call so
|
|
281
282
|
the transport retry policy resends the identical key.
|
|
282
283
|
"""
|
|
@@ -296,20 +297,26 @@ def _attach_request_id(exc: BaseException, request_id: str) -> None:
|
|
|
296
297
|
def _command_request_failure(exc: Exception, *, command: str, request_id: str) -> Exception:
|
|
297
298
|
"""Return the exception a failed signal or update call should raise.
|
|
298
299
|
|
|
299
|
-
A ``request_id_conflict`` refusal that reached
|
|
300
|
-
:class:`ServerError` becomes the command's typed
|
|
301
|
-
exception is returned unchanged, annotated with the
|
|
300
|
+
A ``request_id_conflict`` or ``request_id_ambiguous`` refusal that reached
|
|
301
|
+
the caller as a generic :class:`ServerError` becomes the command's typed
|
|
302
|
+
failure. Every other exception is returned unchanged, annotated with the
|
|
303
|
+
key that was sent.
|
|
302
304
|
"""
|
|
303
|
-
if isinstance(exc, ServerError)
|
|
305
|
+
reason = exc.reason() if isinstance(exc, ServerError) else None
|
|
306
|
+
if isinstance(exc, ServerError) and reason in (REQUEST_ID_CONFLICT, REQUEST_ID_AMBIGUOUS):
|
|
304
307
|
message = exc.body.get("message") if isinstance(exc.body, dict) else None
|
|
305
308
|
if not isinstance(message, str) or not message:
|
|
306
|
-
message =
|
|
309
|
+
message = (
|
|
310
|
+
f"{command} request id already retained with a different intent"
|
|
311
|
+
if reason == REQUEST_ID_CONFLICT
|
|
312
|
+
else f"{command} request id matches an ambiguous retained command identity"
|
|
313
|
+
)
|
|
307
314
|
if command == "update" and isinstance(exc.body, dict):
|
|
308
315
|
return UpdateFailed(
|
|
309
|
-
message, status=exc.status, body=exc.body, reason=
|
|
316
|
+
message, status=exc.status, body=exc.body, reason=reason, request_id=request_id,
|
|
310
317
|
)
|
|
311
318
|
return SignalFailed(
|
|
312
|
-
message, reason=
|
|
319
|
+
message, reason=reason, status=exc.status, body=exc.body, request_id=request_id,
|
|
313
320
|
)
|
|
314
321
|
_attach_request_id(exc, request_id)
|
|
315
322
|
return exc
|
|
@@ -4892,7 +4899,7 @@ class Client:
|
|
|
4892
4899
|
:class:`WorkflowHandle` forwards its run identity automatically.
|
|
4893
4900
|
|
|
4894
4901
|
``request_id`` is the caller command key (1-255 opaque, case-sensitive
|
|
4895
|
-
|
|
4902
|
+
Unicode characters). When omitted the client
|
|
4896
4903
|
generates ``sdk-python-signal-<uuid>`` once per call, so the transport
|
|
4897
4904
|
retry policy resends the same key. Resending the same key with the same
|
|
4898
4905
|
signal name, arguments and run target returns the original receipt
|
|
@@ -4907,7 +4914,12 @@ class Client:
|
|
|
4907
4914
|
:class:`~durable_workflow.errors.SignalFailed` with
|
|
4908
4915
|
``reason == "request_id_conflict"`` when the key was already retained
|
|
4909
4916
|
for a signal with a different intent; the retained command is described
|
|
4910
|
-
in its ``details``.
|
|
4917
|
+
in its ``details``. ``reason == "request_id_ambiguous"`` means the key
|
|
4918
|
+
matches an ambiguous legacy retained identity: nothing was written and
|
|
4919
|
+
no receipt was selected. A legacy receipt retained before the Server
|
|
4920
|
+
recorded intent is returned with ``retained`` ``True`` and
|
|
4921
|
+
``intent_verified`` ``False``; it is the original admission, not proof
|
|
4922
|
+
that this retry's intent matches. Every exception raised after the key was chosen,
|
|
4911
4923
|
including transport errors, carries it as ``request_id``.
|
|
4912
4924
|
"""
|
|
4913
4925
|
if run_id is not None and (not isinstance(run_id, str) or not run_id):
|
|
@@ -5132,7 +5144,7 @@ class Client:
|
|
|
5132
5144
|
:meth:`update_outcome`, which never admits another update.
|
|
5133
5145
|
|
|
5134
5146
|
``request_id`` is the caller command key (1-255 opaque, case-sensitive
|
|
5135
|
-
|
|
5147
|
+
Unicode characters) that makes a retry of this update safe. When omitted the client
|
|
5136
5148
|
generates ``sdk-python-update-<uuid>`` once per call, so the transport
|
|
5137
5149
|
retry policy resends the same key. Resending the same key with the same
|
|
5138
5150
|
update name, arguments and run target returns the original receipt
|
|
@@ -5148,7 +5160,10 @@ class Client:
|
|
|
5148
5160
|
with the failure message, Server response and durable identities; the
|
|
5149
5161
|
same type with ``reason == "request_id_conflict"`` reports a key that
|
|
5150
5162
|
was already retained for an update with a different intent, described
|
|
5151
|
-
in its ``details
|
|
5163
|
+
in its ``details``, and ``reason == "request_id_ambiguous"`` a key that
|
|
5164
|
+
matches an ambiguous legacy retained identity (nothing written, no
|
|
5165
|
+
receipt selected). A legacy receipt is returned with ``retained``
|
|
5166
|
+
``True`` and ``intent_verified`` ``False``. Every exception raised after the key was chosen,
|
|
5152
5167
|
including transport errors, carries it as ``request_id``.
|
|
5153
5168
|
"""
|
|
5154
5169
|
await self._require_update_wait_stage(wait_for or "accepted")
|
|
@@ -586,6 +586,13 @@ class QueryFailed(DurableWorkflowError):
|
|
|
586
586
|
REQUEST_ID_CONFLICT = "request_id_conflict"
|
|
587
587
|
"""Reason reported when a command key is reused with a different intent."""
|
|
588
588
|
|
|
589
|
+
REQUEST_ID_AMBIGUOUS = "request_id_ambiguous"
|
|
590
|
+
"""Reason reported when a command key matches an ambiguous legacy retained identity.
|
|
591
|
+
|
|
592
|
+
Nothing was written and no retained receipt was selected. Inspect the original
|
|
593
|
+
command before sending the input again under a new key.
|
|
594
|
+
"""
|
|
595
|
+
|
|
589
596
|
_REQUEST_ID_CONFLICT_FIELDS = (
|
|
590
597
|
"request_id",
|
|
591
598
|
"retained_command_id",
|
|
@@ -603,11 +610,22 @@ def _body_string(body: object, name: str) -> str | None:
|
|
|
603
610
|
return None
|
|
604
611
|
|
|
605
612
|
|
|
613
|
+
_REQUEST_ID_AMBIGUOUS_FIELDS = ("request_id", "outcome", "retained", "intent_verified", "retryable")
|
|
614
|
+
|
|
615
|
+
|
|
606
616
|
def _request_id_conflict_details(body: object) -> dict[str, Any]:
|
|
607
|
-
"""Return the retained-command fields of a
|
|
608
|
-
|
|
617
|
+
"""Return the retained-command fields of a command-key refusal body.
|
|
618
|
+
|
|
619
|
+
``request_id_conflict`` carries the retained command; ``request_id_ambiguous``
|
|
620
|
+
carries only its refusal markers because no retained receipt was selected.
|
|
621
|
+
"""
|
|
622
|
+
if not isinstance(body, dict):
|
|
609
623
|
return {}
|
|
610
|
-
|
|
624
|
+
if body.get("reason") == REQUEST_ID_CONFLICT:
|
|
625
|
+
return {name: body[name] for name in _REQUEST_ID_CONFLICT_FIELDS if name in body}
|
|
626
|
+
if body.get("reason") == REQUEST_ID_AMBIGUOUS:
|
|
627
|
+
return {name: body[name] for name in _REQUEST_ID_AMBIGUOUS_FIELDS if name in body}
|
|
628
|
+
return {}
|
|
611
629
|
|
|
612
630
|
|
|
613
631
|
class SignalFailed(DurableWorkflowError):
|
|
@@ -620,7 +638,10 @@ class SignalFailed(DurableWorkflowError):
|
|
|
620
638
|
already retained for a signal with a different intent, and
|
|
621
639
|
:attr:`details` then carries ``retained_command_id``,
|
|
622
640
|
``retained_command_type``, ``retained_outcome`` and the mismatched
|
|
623
|
-
``conflict`` parts.
|
|
641
|
+
``conflict`` parts. ``request_id_ambiguous`` means the key matches an
|
|
642
|
+
ambiguous legacy retained identity; nothing was written, no receipt was
|
|
643
|
+
selected, and :attr:`details` carries ``retained`` and
|
|
644
|
+
``intent_verified`` (``False``).
|
|
624
645
|
"""
|
|
625
646
|
|
|
626
647
|
def __init__(
|
|
@@ -732,7 +753,9 @@ class UpdateFailed(InvalidArgument):
|
|
|
732
753
|
means the key was already retained for an update with a different intent,
|
|
733
754
|
and :attr:`details` then carries ``retained_command_id``,
|
|
734
755
|
``retained_command_type``, ``retained_outcome`` and the mismatched
|
|
735
|
-
``conflict`` parts.
|
|
756
|
+
``conflict`` parts. ``request_id_ambiguous`` means the key matches an
|
|
757
|
+
ambiguous legacy retained identity; nothing was written and no receipt
|
|
758
|
+
was selected.
|
|
736
759
|
"""
|
|
737
760
|
|
|
738
761
|
def __init__(
|
|
@@ -1267,15 +1290,20 @@ def _raise_for_status(
|
|
|
1267
1290
|
raise UpdateRejected(message or "update rejected", body=body)
|
|
1268
1291
|
if reason in update_validation_failure_reasons:
|
|
1269
1292
|
raise update_validation_failed("update validation failed")
|
|
1270
|
-
if reason
|
|
1293
|
+
if reason in (REQUEST_ID_CONFLICT, REQUEST_ID_AMBIGUOUS):
|
|
1271
1294
|
# The retained command type names the key scope; the Server also
|
|
1272
1295
|
# labels the control-plane operation. Either selects the typed failure.
|
|
1273
1296
|
command_type = _body_string(body, "retained_command_type") or operation
|
|
1297
|
+
refusal = (
|
|
1298
|
+
"already retained with a different intent"
|
|
1299
|
+
if reason == REQUEST_ID_CONFLICT
|
|
1300
|
+
else "matches an ambiguous retained command identity"
|
|
1301
|
+
)
|
|
1274
1302
|
if command_type == "signal":
|
|
1275
|
-
raise signal_failed("signal request id
|
|
1303
|
+
raise signal_failed(f"signal request id {refusal}")
|
|
1276
1304
|
if command_type == "update" and isinstance(body, dict):
|
|
1277
1305
|
raise UpdateFailed(
|
|
1278
|
-
message or "update request id
|
|
1306
|
+
message or f"update request id {refusal}",
|
|
1279
1307
|
status=status,
|
|
1280
1308
|
body=body,
|
|
1281
1309
|
)
|
|
@@ -5,6 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import asyncio
|
|
6
6
|
import contextlib
|
|
7
7
|
import functools
|
|
8
|
+
import gc
|
|
8
9
|
import re
|
|
9
10
|
import threading
|
|
10
11
|
from collections.abc import Callable, Iterator, Mapping, Sequence
|
|
@@ -87,9 +88,22 @@ def discarded(function: Callable[_P, _T]) -> Callable[_P, _T]:
|
|
|
87
88
|
return invoke
|
|
88
89
|
|
|
89
90
|
|
|
91
|
+
def _collection(phase: str, info: Mapping[str, int]) -> None:
|
|
92
|
+
# Cyclic GC finalizes unreachable objects in an unspecified order, so a
|
|
93
|
+
# discarded workflow generator can be closed by its own finalizer before
|
|
94
|
+
# the replay lifetime that would close it inside ``discarded``. Code that
|
|
95
|
+
# the collector runs is disposal on the collecting thread, never workflow
|
|
96
|
+
# progress, and must not borrow whichever clock happens to be active.
|
|
97
|
+
_DISCARD.collecting = phase == "start"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
gc.callbacks.append(_collection)
|
|
101
|
+
|
|
102
|
+
|
|
90
103
|
def read(owner: object) -> datetime:
|
|
91
104
|
frame = _ACTIVE.get()
|
|
92
|
-
if (getattr(_DISCARD, "active", False) or
|
|
105
|
+
if (getattr(_DISCARD, "active", False) or getattr(_DISCARD, "collecting", False)
|
|
106
|
+
or frame is None or frame.owner is not owner or frame.time is None
|
|
93
107
|
or frame.thread != threading.get_ident() or frame.task is not _task()):
|
|
94
108
|
raise ReplayClockUnavailable()
|
|
95
109
|
return frame.time
|
|
@@ -2226,6 +2226,48 @@ class _OpenCancellationScope:
|
|
|
2226
2226
|
shield_parent: bool
|
|
2227
2227
|
|
|
2228
2228
|
|
|
2229
|
+
@dataclass(frozen=True)
|
|
2230
|
+
class ScheduleOrigin:
|
|
2231
|
+
"""The schedule fire that started a run, read from its ``ScheduleTriggered`` event.
|
|
2232
|
+
|
|
2233
|
+
``occurrence_time`` is the time the scheduler evaluated: the jittered fire
|
|
2234
|
+
time for a tick, or the enumerated time for a backfill. It is not the run's
|
|
2235
|
+
actual start time. It is ``None`` for a fire recorded without an occurrence,
|
|
2236
|
+
such as a manual trigger.
|
|
2237
|
+
"""
|
|
2238
|
+
|
|
2239
|
+
schedule_id: str
|
|
2240
|
+
occurrence_time: datetime | None
|
|
2241
|
+
trigger_number: int | None
|
|
2242
|
+
|
|
2243
|
+
|
|
2244
|
+
def _schedule_origin(events: Iterable[Mapping[str, Any]]) -> ScheduleOrigin | None:
|
|
2245
|
+
"""The run's own schedule origin from recorded history, or ``None``."""
|
|
2246
|
+
for event in events:
|
|
2247
|
+
if _history_event_type(event) != "ScheduleTriggered":
|
|
2248
|
+
continue
|
|
2249
|
+
payload = event.get("payload")
|
|
2250
|
+
if not isinstance(payload, Mapping):
|
|
2251
|
+
return None
|
|
2252
|
+
schedule_id = payload.get("schedule_id")
|
|
2253
|
+
if not isinstance(schedule_id, str) or schedule_id == "":
|
|
2254
|
+
return None
|
|
2255
|
+
occurrence: datetime | None = None
|
|
2256
|
+
recorded = payload.get("occurrence_time")
|
|
2257
|
+
if isinstance(recorded, str):
|
|
2258
|
+
with contextlib.suppress(ValueError):
|
|
2259
|
+
parsed = datetime.fromisoformat(recorded.replace("Z", "+00:00"))
|
|
2260
|
+
if parsed.utcoffset() is not None:
|
|
2261
|
+
occurrence = parsed
|
|
2262
|
+
trigger = payload.get("trigger_number")
|
|
2263
|
+
return ScheduleOrigin(
|
|
2264
|
+
schedule_id=schedule_id,
|
|
2265
|
+
occurrence_time=occurrence,
|
|
2266
|
+
trigger_number=trigger if type(trigger) is int and trigger > 0 else None,
|
|
2267
|
+
)
|
|
2268
|
+
return None
|
|
2269
|
+
|
|
2270
|
+
|
|
2229
2271
|
class WorkflowContext:
|
|
2230
2272
|
"""Replay-safe helper surface passed to workflow ``run`` methods."""
|
|
2231
2273
|
|
|
@@ -2273,6 +2315,7 @@ class WorkflowContext:
|
|
|
2273
2315
|
self._external_storage = external_storage
|
|
2274
2316
|
self._external_storage_cache = external_storage_cache
|
|
2275
2317
|
self._workflow_stream_command_counter = 0
|
|
2318
|
+
self._schedule_origin: ScheduleOrigin | None = None
|
|
2276
2319
|
self.logger = _ReplayLogger(_REPLAY_LOGGER)
|
|
2277
2320
|
|
|
2278
2321
|
@property
|
|
@@ -2285,6 +2328,15 @@ class WorkflowContext:
|
|
|
2285
2328
|
"""Current run identity, stable on replay and new after continue-as-new."""
|
|
2286
2329
|
return self._run_id
|
|
2287
2330
|
|
|
2331
|
+
@property
|
|
2332
|
+
def schedule_origin(self) -> ScheduleOrigin | None:
|
|
2333
|
+
"""The schedule fire that started this run, or ``None`` if no schedule did.
|
|
2334
|
+
|
|
2335
|
+
It comes from the run's recorded ``ScheduleTriggered`` history event, so
|
|
2336
|
+
it is available on the first workflow task and identical on replay.
|
|
2337
|
+
"""
|
|
2338
|
+
return self._schedule_origin
|
|
2339
|
+
|
|
2288
2340
|
def cancellation_scope(
|
|
2289
2341
|
self, body: Callable[[], Any], *, shield_parent: bool = False,
|
|
2290
2342
|
) -> Generator[Any, Any, Any]:
|
|
@@ -4008,6 +4060,10 @@ def _history_event_type(event: Mapping[str, Any]) -> str | None:
|
|
|
4008
4060
|
# terminal event. The workflow had already moved past those operations, so the
|
|
4009
4061
|
# cancellation is never an outcome replay can observe: the activity stays open.
|
|
4010
4062
|
RUN_CLOSED_CANCELLATION_REASON = "run_closed"
|
|
4063
|
+
# The side-effect key under which a worker records which member of an
|
|
4064
|
+
# absent-policy all-group it raised while other members were open
|
|
4065
|
+
# (sdk-python#338). Replay raises exactly that member.
|
|
4066
|
+
PARALLEL_FAILURE_DECISION = "durable_workflow.parallel_failure_decision"
|
|
4011
4067
|
|
|
4012
4068
|
|
|
4013
4069
|
def _settled_at_close(event: Any) -> bool:
|
|
@@ -5123,6 +5179,21 @@ def _replay_state(
|
|
|
5123
5179
|
search_attribute_sequences: set[int] = set()
|
|
5124
5180
|
upsert_sequences: set[int] = set()
|
|
5125
5181
|
delivery_ranges: list[range] = []
|
|
5182
|
+
# Where the workflow's own durable work first appears, by sequence, and
|
|
5183
|
+
# where it first closed the run. An absent-policy all-group uses these to
|
|
5184
|
+
# tell whether the workflow moved on before every member settled.
|
|
5185
|
+
first_command_index_by_sequence: dict[int, int] = {}
|
|
5186
|
+
authored_close_index: int | None = None
|
|
5187
|
+
for event_index, event in enumerate(events):
|
|
5188
|
+
event_type = _history_event_type(event)
|
|
5189
|
+
payload = event.get("payload") or {}
|
|
5190
|
+
sequence = _workflow_sequence(payload) if isinstance(payload, Mapping) else None
|
|
5191
|
+
if sequence is not None and event_type in _DURABLE_COMMAND_KINDS:
|
|
5192
|
+
first_command_index_by_sequence.setdefault(sequence, event_index)
|
|
5193
|
+
if authored_close_index is None and event_type in (
|
|
5194
|
+
"WorkflowCompleted", "WorkflowFailed", "WorkflowContinuedAsNew",
|
|
5195
|
+
):
|
|
5196
|
+
authored_close_index = event_index
|
|
5126
5197
|
|
|
5127
5198
|
for event in events:
|
|
5128
5199
|
event_type = _history_event_type(event)
|
|
@@ -5312,6 +5383,7 @@ def _replay_state(
|
|
|
5312
5383
|
_allow_wall_clock=not events,
|
|
5313
5384
|
)
|
|
5314
5385
|
ctx._replay_clock_error = replay_clock_error if workflow_start_time is None else None
|
|
5386
|
+
ctx._schedule_origin = _schedule_origin(events)
|
|
5315
5387
|
ctx._business_clock = replay_clock.BusinessReplayClock(
|
|
5316
5388
|
events, workflow_id or "", run_id, sequence_claim=_workflow_sequence,
|
|
5317
5389
|
)
|
|
@@ -7453,8 +7525,93 @@ def _replay_state(
|
|
|
7453
7525
|
except StopIteration as stop:
|
|
7454
7526
|
return _terminal_state(stop.value, include_pending=True)
|
|
7455
7527
|
|
|
7528
|
+
def _group_is_open(commands: list[Any]) -> bool:
|
|
7529
|
+
"""Whether an earlier task already scheduled this group's members.
|
|
7530
|
+
|
|
7531
|
+
Server assigned their sequences then. Sending the batch again would ask
|
|
7532
|
+
for a new group at the next free sequence, which Server refuses with
|
|
7533
|
+
``parallel_sequence_mismatch`` (sdk-python#338).
|
|
7534
|
+
"""
|
|
7535
|
+
base = commands[0]._parallel_group_path[0]["parallel_group_base_sequence"]
|
|
7536
|
+
return any(sequence in event_types_by_sequence for sequence in range(base, base + len(commands)))
|
|
7537
|
+
|
|
7538
|
+
def _parallel_failure_marker(commands: list[Any]) -> int | None:
|
|
7539
|
+
"""The member sequence a recorded early-failure decision names, if any.
|
|
7540
|
+
|
|
7541
|
+
The decision is the first command after the group, so it has the
|
|
7542
|
+
sequence right after the last member.
|
|
7543
|
+
"""
|
|
7544
|
+
root = commands[0]._parallel_group_path[0]
|
|
7545
|
+
base = root["parallel_group_base_sequence"]
|
|
7546
|
+
end = base + len(commands)
|
|
7547
|
+
for index in range(result_cursor, len(recorded_steps)):
|
|
7548
|
+
step = recorded_steps[index]
|
|
7549
|
+
value = resolved_results[index]
|
|
7550
|
+
if (step.workflow_sequence != end or step.shape != "side effect"
|
|
7551
|
+
or not isinstance(value, Mapping) or PARALLEL_FAILURE_DECISION not in value):
|
|
7552
|
+
continue
|
|
7553
|
+
decision = value[PARALLEL_FAILURE_DECISION]
|
|
7554
|
+
member = decision.get("member_sequence") if isinstance(decision, Mapping) else None
|
|
7555
|
+
if (not isinstance(decision, Mapping)
|
|
7556
|
+
or decision.get("parallel_group_id") != root["parallel_group_id"]
|
|
7557
|
+
or decision.get("parallel_group_base_sequence") != base
|
|
7558
|
+
or decision.get("parallel_group_size") != len(commands)
|
|
7559
|
+
or type(member) is not int or not base <= member < end):
|
|
7560
|
+
raise NonDeterministicReplayError(
|
|
7561
|
+
end, "parallel failure decision for this group", step.event_types,
|
|
7562
|
+
detail="recorded parallel failure decision does not match the replayed group",
|
|
7563
|
+
)
|
|
7564
|
+
return member
|
|
7565
|
+
return None
|
|
7566
|
+
|
|
7567
|
+
def _absent_policy_failure_decision(commands: list[Any]) -> tuple[bool, int | None, bool]:
|
|
7568
|
+
"""How an absent-policy all-group handles a member failure.
|
|
7569
|
+
|
|
7570
|
+
Returns whether the failure is raised early, the member sequence a
|
|
7571
|
+
recorded decision names, and whether this task must record the
|
|
7572
|
+
decision.
|
|
7573
|
+
|
|
7574
|
+
Server wakes the workflow once, when the first member fails, and never
|
|
7575
|
+
again for that group: a later successful member does not wake it,
|
|
7576
|
+
because the group can no longer complete successfully. Workflow's
|
|
7577
|
+
embedded engine raises that failure at once. So when a member has
|
|
7578
|
+
failed and a sibling is still open, the failure is raised now instead
|
|
7579
|
+
of waiting for a wake that never comes (sdk-python#338).
|
|
7580
|
+
|
|
7581
|
+
History has no workflow-task boundaries, so a later replay cannot tell
|
|
7582
|
+
which member outcomes the deciding task saw: another member can fail
|
|
7583
|
+
after the task read history but before its completion is written. The
|
|
7584
|
+
task therefore records its decision as a side effect directly after the
|
|
7585
|
+
group, and replay raises exactly the member it names.
|
|
7586
|
+
|
|
7587
|
+
A history without a decision replays as it always has when every
|
|
7588
|
+
member settled before the workflow did any further durable work: the
|
|
7589
|
+
workflow waited for the whole group and the failure is chosen by member
|
|
7590
|
+
position. A history without a decision that moved on while a member was
|
|
7591
|
+
open came from another runtime, such as Workflow's embedded engine, and
|
|
7592
|
+
raises its first recorded failure.
|
|
7593
|
+
"""
|
|
7594
|
+
marked = _parallel_failure_marker(commands)
|
|
7595
|
+
if marked is not None:
|
|
7596
|
+
return True, marked, False
|
|
7597
|
+
base = commands[0]._parallel_group_path[0]["parallel_group_base_sequence"]
|
|
7598
|
+
end = base + len(commands)
|
|
7599
|
+
slots = [index for index in range(result_cursor, len(recorded_steps))
|
|
7600
|
+
if base <= recorded_steps[index].workflow_sequence < end]
|
|
7601
|
+
if not any(isinstance(resolved_results[index], ActivityFailed | ChildWorkflowFailed) for index in slots):
|
|
7602
|
+
return False, None, False
|
|
7603
|
+
moved_on = [index for sequence, index in first_command_index_by_sequence.items() if sequence >= end]
|
|
7604
|
+
if authored_close_index is not None:
|
|
7605
|
+
moved_on.append(authored_close_index)
|
|
7606
|
+
if len({recorded_steps[index].workflow_sequence for index in slots}) != len(commands):
|
|
7607
|
+
return True, None, not moved_on
|
|
7608
|
+
settled = [recorded_steps[index].history_index for index in slots]
|
|
7609
|
+
if any(index is None for index in settled) or not moved_on:
|
|
7610
|
+
return False, None, False
|
|
7611
|
+
return min(moved_on) < max(cast(list[int], settled)), None, False
|
|
7612
|
+
|
|
7456
7613
|
def _consume_propagating_group(
|
|
7457
|
-
commands: list[Any],
|
|
7614
|
+
commands: list[Any], marked: int | None = None,
|
|
7458
7615
|
) -> tuple[list[Any], list[_RecordedStep], ActivityFailed | ChildWorkflowFailed | None] | None:
|
|
7459
7616
|
base = commands[0]._parallel_group_path[0]["parallel_group_base_sequence"]
|
|
7460
7617
|
slots = [index for index in range(result_cursor, len(recorded_steps))
|
|
@@ -7466,6 +7623,13 @@ def _replay_state(
|
|
|
7466
7623
|
failures = [index for index in slots
|
|
7467
7624
|
if isinstance(resolved_results[index], ActivityFailed | ChildWorkflowFailed)]
|
|
7468
7625
|
selected = min(failures, key=lambda index: cast(int, recorded_steps[index].history_index)) if failures else None
|
|
7626
|
+
if marked is not None:
|
|
7627
|
+
selected = next((index for index in failures if recorded_steps[index].workflow_sequence == marked), None)
|
|
7628
|
+
if selected is None:
|
|
7629
|
+
raise NonDeterministicReplayError(
|
|
7630
|
+
marked, "the failed member a parallel failure decision names", event_types_by_sequence.get(
|
|
7631
|
+
marked, []), detail="recorded parallel failure decision names a member that did not fail",
|
|
7632
|
+
)
|
|
7469
7633
|
if selected is None and len(slots) != len(commands):
|
|
7470
7634
|
return None
|
|
7471
7635
|
ordered = sorted(slots, key=lambda index: recorded_steps[index].workflow_sequence)
|
|
@@ -7778,15 +7942,22 @@ def _replay_state(
|
|
|
7778
7942
|
prepared_group = prepare_local_activities and _contains_local_activity(cmd)
|
|
7779
7943
|
cmd, result_shape = _annotate_parallel_commands(cmd, current_call_sequence if prepared_group else None)
|
|
7780
7944
|
needed = len(cmd)
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7945
|
+
local_group = prepared_group or any(isinstance(leaf, RecordLocalActivity) for leaf in cmd)
|
|
7946
|
+
explicit_propagate = bool(cmd) and cmd[0]._parallel_group_path[0].get(
|
|
7947
|
+
"parallel_group_policy") == "propagate"
|
|
7948
|
+
if explicit_propagate and local_group:
|
|
7949
|
+
raise LocalActivityExecutionAborted("parallel_group_policy requires qualified local admission")
|
|
7950
|
+
fails_fast, marked, record_decision = (
|
|
7951
|
+
_absent_policy_failure_decision(cmd) if cmd and not local_group and not explicit_propagate
|
|
7952
|
+
else (False, None, False)
|
|
7953
|
+
)
|
|
7954
|
+
if explicit_propagate or fails_fast:
|
|
7955
|
+
consumed = _consume_propagating_group(cmd, marked)
|
|
7785
7956
|
if consumed is None:
|
|
7786
7957
|
_set_replaying(False)
|
|
7787
7958
|
for offset, leaf in enumerate(cmd):
|
|
7788
7959
|
_assert_pending_step_matches(leaf, offset)
|
|
7789
|
-
return _state([*pending, *cmd])
|
|
7960
|
+
return _state(pending if _group_is_open(cmd) else [*pending, *cmd])
|
|
7790
7961
|
vals, consumed_steps, failed = consumed
|
|
7791
7962
|
if failed is not None:
|
|
7792
7963
|
failed_step = next(step for step, value in zip(consumed_steps, vals, strict=True)
|
|
@@ -7801,12 +7972,33 @@ def _replay_state(
|
|
|
7801
7972
|
)
|
|
7802
7973
|
else:
|
|
7803
7974
|
ctx._business_clock.unavailable()
|
|
7975
|
+
if marked is not None:
|
|
7976
|
+
# The recorded decision is the next durable step.
|
|
7977
|
+
decision_step = recorded_steps[result_cursor]
|
|
7978
|
+
if (decision_step.workflow_sequence
|
|
7979
|
+
!= cmd[0]._parallel_group_path[0]["parallel_group_base_sequence"] + needed):
|
|
7980
|
+
raise NonDeterministicReplayError(
|
|
7981
|
+
decision_step.workflow_sequence, "parallel failure decision",
|
|
7982
|
+
decision_step.event_types,
|
|
7983
|
+
detail="parallel failure decision is not the step after its group",
|
|
7984
|
+
)
|
|
7985
|
+
result_cursor += 1
|
|
7986
|
+
authored_sequence = max(authored_sequence, decision_step.workflow_sequence + 1)
|
|
7987
|
+
elif record_decision:
|
|
7988
|
+
root = cmd[0]._parallel_group_path[0]
|
|
7989
|
+
pending.append(RecordSideEffect({PARALLEL_FAILURE_DECISION: {
|
|
7990
|
+
"parallel_group_id": root["parallel_group_id"],
|
|
7991
|
+
"parallel_group_base_sequence": root["parallel_group_base_sequence"],
|
|
7992
|
+
"parallel_group_size": needed,
|
|
7993
|
+
"member_sequence": failed_step.workflow_sequence,
|
|
7994
|
+
}}))
|
|
7995
|
+
authored_sequence += 1
|
|
7804
7996
|
try:
|
|
7805
7997
|
_refresh_replay_logging()
|
|
7806
7998
|
advanced_cmd = _resume_business(gen.throw, failed)
|
|
7807
7999
|
continue
|
|
7808
8000
|
except StopIteration as stop:
|
|
7809
|
-
return _terminal_state(stop.value, include_pending=
|
|
8001
|
+
return _terminal_state(stop.value, include_pending=record_decision)
|
|
7810
8002
|
_advance_cancellation_clock(step.history_index for step in consumed_steps)
|
|
7811
8003
|
try:
|
|
7812
8004
|
typed_values = [_typed_activity_result(leaf, value)
|
|
@@ -7894,6 +8086,10 @@ def _replay_state(
|
|
|
7894
8086
|
_set_replaying(False)
|
|
7895
8087
|
for offset, child_command in enumerate(cmd):
|
|
7896
8088
|
_assert_pending_step_matches(child_command, offset)
|
|
8089
|
+
if cmd and _group_is_open(cmd):
|
|
8090
|
+
# The members are already scheduled. Wait for them; a new
|
|
8091
|
+
# batch would be a second group (sdk-python#338).
|
|
8092
|
+
return _state(pending)
|
|
7897
8093
|
pending.extend(cmd)
|
|
7898
8094
|
return _state(pending)
|
|
7899
8095
|
if isinstance(cmd, DurableOperationHandle):
|
{durable_workflow-2.18.0 → durable_workflow-2.19.1}/src/durable_workflow.egg-info/SOURCES.txt
RENAMED
|
@@ -141,6 +141,7 @@ tests/test_nexus_wire.py
|
|
|
141
141
|
tests/test_order_processing_example.py
|
|
142
142
|
tests/test_parallel_completion_order_replay.py
|
|
143
143
|
tests/test_parallel_group_policy.py
|
|
144
|
+
tests/test_parallel_member_failure_open_siblings.py
|
|
144
145
|
tests/test_parallel_saga_authoring.py
|
|
145
146
|
tests/test_patch_history.py
|
|
146
147
|
tests/test_pending_operation_replay.py
|
|
@@ -161,6 +162,7 @@ tests/test_python_conformance.py
|
|
|
161
162
|
tests/test_queries.py
|
|
162
163
|
tests/test_query_task_authority.py
|
|
163
164
|
tests/test_query_timeout_retry.py
|
|
165
|
+
tests/test_quiesced_snapshot.py
|
|
164
166
|
tests/test_readme_quickstart.py
|
|
165
167
|
tests/test_redrive_call_ledger.py
|
|
166
168
|
tests/test_redrive_replay.py
|
|
@@ -180,6 +182,7 @@ tests/test_run_activities.py
|
|
|
180
182
|
tests/test_run_cancellation_scope_replay.py
|
|
181
183
|
tests/test_run_closed_settlement_replay.py
|
|
182
184
|
tests/test_runtime_external_payload_transport.py
|
|
185
|
+
tests/test_schedule_origin.py
|
|
183
186
|
tests/test_schedules.py
|
|
184
187
|
tests/test_scoped_run_cancellation_context.py
|
|
185
188
|
tests/test_sdk_metrics_contract.py
|
|
@@ -194,6 +197,7 @@ tests/test_sticky_history_suffix.py
|
|
|
194
197
|
tests/test_storage_admission.py
|
|
195
198
|
tests/test_sync.py
|
|
196
199
|
tests/test_sync_activities.py
|
|
200
|
+
tests/test_synthetic_command_key_readback.py
|
|
197
201
|
tests/test_telemetry.py
|
|
198
202
|
tests/test_telemetry_carrier.py
|
|
199
203
|
tests/test_testing_failures.py
|
|
@@ -84,7 +84,7 @@ def approval(digest="a" * 64):
|
|
|
84
84
|
|
|
85
85
|
def test_effective_lock_adds_only_the_approved_sdk_to_the_fixed_dependencies():
|
|
86
86
|
result, digest = release.lock(b"pytest==1 --hash=sha256:" + b"c" * 64 + b"\n", approval())
|
|
87
|
-
assert result.endswith(f"durable-workflow==2.
|
|
87
|
+
assert result.endswith(f"durable-workflow==2.19.1 --hash=sha256:{digest}\n".encode())
|
|
88
88
|
assert result.count(b"durable-workflow") == 1
|
|
89
89
|
|
|
90
90
|
|
|
@@ -364,6 +364,47 @@ def test_discard_keeps_generator_context_tokens_and_cannot_borrow_parent_time(co
|
|
|
364
364
|
assert _ACTIVE_WORKFLOW_REPLAY.get() is None
|
|
365
365
|
|
|
366
366
|
|
|
367
|
+
def test_discarded_generator_cannot_borrow_parent_time_in_any_cyclic_finalizer_order() -> None:
|
|
368
|
+
# CPython does not order finalizers within one cyclic collection. When an
|
|
369
|
+
# automatic collection runs during the discarded replay, the generator can
|
|
370
|
+
# be finalized before the lifetime that closes it as a discard (#343).
|
|
371
|
+
# Start the next automatic collection at every point across one threshold.
|
|
372
|
+
thresholds = gc.get_threshold()
|
|
373
|
+
gc.set_threshold(700, 10, 10)
|
|
374
|
+
try:
|
|
375
|
+
for padding_size in range(0, 700, 16):
|
|
376
|
+
gc.collect()
|
|
377
|
+
padding = [[] for _ in range(padding_size)]
|
|
378
|
+
test_discard_keeps_generator_context_tokens_and_cannot_borrow_parent_time(True)
|
|
379
|
+
del padding
|
|
380
|
+
finally:
|
|
381
|
+
gc.set_threshold(*thresholds)
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
def test_code_run_by_cyclic_collection_cannot_borrow_active_time() -> None:
|
|
385
|
+
observations: list[Any] = []
|
|
386
|
+
|
|
387
|
+
class Finalized:
|
|
388
|
+
def __init__(self, ctx: WorkflowContext) -> None:
|
|
389
|
+
self.ctx = ctx
|
|
390
|
+
self.cycle = self
|
|
391
|
+
|
|
392
|
+
def __del__(self) -> None:
|
|
393
|
+
observations.append(clock_text(self.ctx))
|
|
394
|
+
|
|
395
|
+
class Parent:
|
|
396
|
+
def run(self, ctx: WorkflowContext): # type: ignore[no-untyped-def]
|
|
397
|
+
yield ctx.schedule_activity("clock.first", [])
|
|
398
|
+
before = ctx.replay_now()
|
|
399
|
+
Finalized(ctx)
|
|
400
|
+
gc.collect()
|
|
401
|
+
assert observations == [None]
|
|
402
|
+
assert ctx.replay_now() == before
|
|
403
|
+
return clock_text(ctx)
|
|
404
|
+
|
|
405
|
+
assert result(history()[:3], Parent) == "2026-11-01T00:00:03.123456+00:00"
|
|
406
|
+
|
|
407
|
+
|
|
367
408
|
def _native_fixture() -> dict[str, Any]:
|
|
368
409
|
from tests.native_redrive_fixture import check_native_redrive_successor
|
|
369
410
|
from tests.test_replay_clock import redrive_fixture
|