durable-workflow 2.17.1__tar.gz → 2.17.2__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.17.1/src/durable_workflow.egg-info → durable_workflow-2.17.2}/PKG-INFO +1 -1
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/pyproject.toml +3 -3
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/__init__.py +2 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/cancellation.py +24 -4
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/client.py +15 -4
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/errors.py +32 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/replay_clock.py +13 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/workflow.py +216 -7
- {durable_workflow-2.17.1 → durable_workflow-2.17.2/src/durable_workflow.egg-info}/PKG-INFO +1 -1
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/SOURCES.txt +3 -0
- durable_workflow-2.17.2/tests/test_cancellation_cause.py +227 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_client.py +32 -0
- durable_workflow-2.17.2/tests/test_parallel_group_policy.py +397 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_publish_workflow_isolation.py +3 -1
- durable_workflow-2.17.2/tests/test_release_promotion.py +294 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_replay_regression_corpus.py +18 -1
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/LICENSE +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/README.md +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/setup.cfg +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_activity_lease.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_activity_process.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_avro.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_cancellation_scope.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_cancellation_scope_history.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_condition_fingerprint.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_cooperative_cancellation.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_failure_reporting.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_metric_routes.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_poll_transport.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_prepared_local_activity.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_query_task_authority.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_sticky_workflow_cache.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/_typed_values.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/activity.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/auth_composition.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/external_storage.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/external_task_input.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/external_task_result.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/history_bundle_verify.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/interceptors.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/invocable.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/metrics.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/nexus.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/py.typed +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/python_conformance.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/replay_clock_math.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/replay_conformance.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/replay_verify.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/retry_policy.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/serializer.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/server_compatibility.json +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/sync.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/telemetry.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/telemetry_carrier.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/testing.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/worker.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/worker_session.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/worker_status.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow/workflow_updates_conformance.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/dependency_links.txt +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/entry_points.txt +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/requires.txt +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/top_level.txt +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_cancellation_policies.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_context.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_heartbeat_authority.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_identity.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_lease_authority.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_lease_renewal.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_lease_worker.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_process.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_retry_info.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_activity_run_closed_refusal.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_auth_composition.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_avro_value_benchmark.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_avro_value_protocol.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_business_replay_clock.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_business_replay_clock_child.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_business_replay_clock_parallel.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_business_replay_clock_redrive.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_business_replay_clock_sequence_claims.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cancellation_context.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cancellation_remaining_time.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cancellation_scope_admission.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cancellation_scope_authoring.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cancellation_scope_boundary.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cancellation_scope_opening.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_child_workflow_policies.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_ci_checkout.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_ci_integration_endpoint.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_client_iterators.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_client_telemetry.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_client_timeouts.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_codec_regression_corpus.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_committed_cancellation_scope_descendants.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_committed_cancellation_scope_groups.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_committed_cancellation_scope_history.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_committed_cancellation_scope_replay.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_completion_size_limit.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_condition_fingerprint.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_condition_occurrence_id.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_condition_replay_drift.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_control_plane_parity_fixtures.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cooperative_cancellation.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cooperative_cancellation_client.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cooperative_cancellation_worker.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_cooperative_remote_worker.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_docs_release_channel.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_docstring_cross_references.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_durable_selection.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_empty_callback_failure.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_errors.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_external_storage.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_external_task_input.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_external_task_result.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_failure_reporting.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_generator_lifecycle.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_golden_history_replay.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_history_bundle_pruned.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_history_bundle_schema2.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_history_bundle_verify.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_history_event_contract.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_invocable.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_local_activity_backoff.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_local_failure_reporting.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_message_streams.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_metric_routes.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_metrics.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_nexus_durable_wait.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_nexus_namespace.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_nexus_wire.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_order_processing_example.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_parallel_completion_order_replay.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_parallel_saga_authoring.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_patch_history.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_pending_operation_replay.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_poll_failure_backoff.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_poll_transport.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_portal_source_split.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_prepared_local_activity_client.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_prepared_local_activity_groups.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_prepared_local_activity_policies.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_prepared_local_activity_worker.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_public_boundary_scanner.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_pypi_project_surface.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_python_conformance.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_queries.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_query_task_authority.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_query_timeout_retry.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_readme_quickstart.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_redrive_call_ledger.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_redrive_replay.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_redrive_successor_evidence.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_registration_ambiguity.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_release_metadata.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_replay.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_replay_clock.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_replay_conformance.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_replay_verify.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_retry_policy.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_run_activities.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_run_cancellation_scope_replay.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_run_closed_settlement_replay.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_runtime_external_payload_transport.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_schedules.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_scoped_run_cancellation_context.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_sdk_metrics_contract.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_search_attribute_replay_identity.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_serializer.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_signals.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_sleep.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_standalone_activity_client.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_static_credential_validation.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_sticky_execution.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_sticky_history_suffix.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_storage_admission.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_sync.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_sync_activities.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_telemetry.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_telemetry_carrier.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_testing_failures.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_testing_harness.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_testing_nexus.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_threaded_heartbeat_example.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_tls_trust.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_transport_diagnostics.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_typed_values.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_typed_workflow_values.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_update_outcome.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_update_signal_condition_replay.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_updates.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_wait_condition.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker_deregistration.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker_observation.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker_session.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker_startup_buffered.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker_startup_raw.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker_startup_read_budget.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker_startup_snapshot.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker_status.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_worker_telemetry_wire.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_workflow_entry_arguments.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_workflow_entrypoint_validation.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_workflow_handler_validation.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_workflow_identity.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_workflow_result_timeout.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/tests/test_workflow_streams.py +0 -0
- {durable_workflow-2.17.1 → durable_workflow-2.17.2}/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.17.
|
|
7
|
+
version = "2.17.2"
|
|
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.17.
|
|
83
|
-
registry-version = "2.17.
|
|
82
|
+
product-train = "2.17.2"
|
|
83
|
+
registry-version = "2.17.2"
|
|
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"
|
|
@@ -119,6 +119,7 @@ from .errors import (
|
|
|
119
119
|
WorkflowTaskCompletionTooLarge,
|
|
120
120
|
WorkflowTerminated,
|
|
121
121
|
WorkflowTimedOut,
|
|
122
|
+
WorkflowTimeoutCleanupRequested,
|
|
122
123
|
)
|
|
123
124
|
from .external_storage import (
|
|
124
125
|
EXTERNAL_PAYLOAD_REFERENCE_SCHEMA,
|
|
@@ -428,6 +429,7 @@ __all__ = [
|
|
|
428
429
|
"WorkflowTaskCompletionTooLarge",
|
|
429
430
|
"WorkflowTerminated",
|
|
430
431
|
"WorkflowTimedOut",
|
|
432
|
+
"WorkflowTimeoutCleanupRequested",
|
|
431
433
|
"EXTERNAL_TASK_INPUT_CONTRACT_SCHEMA",
|
|
432
434
|
"EXTERNAL_TASK_INPUT_MEDIA_TYPE",
|
|
433
435
|
"EXTERNAL_TASK_INPUT_SCHEMA",
|
|
@@ -68,6 +68,14 @@ def _text(snapshot: Mapping[str, Any], key: str) -> str:
|
|
|
68
68
|
return value
|
|
69
69
|
|
|
70
70
|
|
|
71
|
+
CANCELLATION_CAUSE = "cancellation"
|
|
72
|
+
TIMEOUT_CAUSE = "timeout"
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _format_timestamp(value: datetime) -> str:
|
|
76
|
+
return value.isoformat(timespec="microseconds").replace("+00:00", "Z")
|
|
77
|
+
|
|
78
|
+
|
|
71
79
|
def _timestamp(value: str) -> datetime:
|
|
72
80
|
if not re.fullmatch(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})", value):
|
|
73
81
|
raise ValueError("cancellation timestamp requires an ISO date, time and timezone")
|
|
@@ -112,6 +120,8 @@ class CancellationContext:
|
|
|
112
120
|
lineage: tuple[CancellationLineage, ...]
|
|
113
121
|
_replay_clock: Callable[[], datetime] | None = field(default=None, repr=False, compare=False)
|
|
114
122
|
scope_origin: ScopedCancellationContext | None = None
|
|
123
|
+
cause: str | None = None
|
|
124
|
+
"""``"timeout"`` for a timeout-cleanup request, else ``None`` or ``"cancellation"`` (ordinary)."""
|
|
115
125
|
|
|
116
126
|
def __post_init__(self) -> None:
|
|
117
127
|
object.__setattr__(self, "requester", MappingProxyType(dict(self.requester)))
|
|
@@ -122,6 +132,11 @@ class CancellationContext:
|
|
|
122
132
|
"""The original immutable cleanup deadline."""
|
|
123
133
|
return self.cleanup_deadline_at
|
|
124
134
|
|
|
135
|
+
@property
|
|
136
|
+
def is_timeout(self) -> bool:
|
|
137
|
+
"""Whether the run's work deadline passed and this request opens its timeout cleanup."""
|
|
138
|
+
return self.cause == TIMEOUT_CAUSE
|
|
139
|
+
|
|
125
140
|
def remaining(self) -> float:
|
|
126
141
|
"""Seconds left at the consumed replay boundary, clamped to zero.
|
|
127
142
|
|
|
@@ -194,10 +209,13 @@ class CancellationContext:
|
|
|
194
209
|
raise ValueError("cancellation deadline must follow the original request")
|
|
195
210
|
if scope_origin is not None:
|
|
196
211
|
_assert_scope_origin(snapshot, scope_origin, normalized, normalized_requester, requested_at, deadline)
|
|
212
|
+
cause = snapshot.get("cause")
|
|
213
|
+
if cause is not None and cause not in (CANCELLATION_CAUSE, TIMEOUT_CAUSE):
|
|
214
|
+
raise ValueError("cancellation cause must be cancellation or timeout")
|
|
197
215
|
return cls(
|
|
198
216
|
request_id, root_request_id, root_instance_id, root_run_id, parent_request_id,
|
|
199
217
|
reason, normalized_requester, _text(snapshot, "source"), requested_at, deadline, tuple(normalized),
|
|
200
|
-
scope_origin=scope_origin,
|
|
218
|
+
scope_origin=scope_origin, cause=cause,
|
|
201
219
|
)
|
|
202
220
|
|
|
203
221
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -213,10 +231,12 @@ class CancellationContext:
|
|
|
213
231
|
"reason": self.reason,
|
|
214
232
|
"requester": dict(self.requester),
|
|
215
233
|
"source": self.source,
|
|
216
|
-
"requested_at": self.requested_at
|
|
217
|
-
"cleanup_deadline_at": self.cleanup_deadline_at
|
|
234
|
+
"requested_at": _format_timestamp(self.requested_at),
|
|
235
|
+
"cleanup_deadline_at": _format_timestamp(self.cleanup_deadline_at),
|
|
218
236
|
"lineage": [entry.to_dict() for entry in self.lineage],
|
|
219
237
|
}
|
|
238
|
+
if self.cause is not None:
|
|
239
|
+
snapshot["cause"] = self.cause
|
|
220
240
|
if self.scope_origin is not None:
|
|
221
241
|
snapshot["scope_origin"] = self.scope_origin.to_dict()
|
|
222
242
|
snapshot["scope_authority_deadline_at"] = snapshot["cleanup_deadline_at"]
|
|
@@ -239,7 +259,7 @@ class ScopedCancellationLineage:
|
|
|
239
259
|
"workflow_instance_id": self.workflow_instance_id,
|
|
240
260
|
"workflow_run_id": self.workflow_run_id,
|
|
241
261
|
"scope_id": self.scope_id,
|
|
242
|
-
"cleanup_deadline_at": self.cleanup_deadline_at
|
|
262
|
+
"cleanup_deadline_at": _format_timestamp(self.cleanup_deadline_at),
|
|
243
263
|
}
|
|
244
264
|
|
|
245
265
|
|
|
@@ -22,6 +22,7 @@ import asyncio
|
|
|
22
22
|
import contextlib
|
|
23
23
|
import copy
|
|
24
24
|
import hashlib
|
|
25
|
+
import json
|
|
25
26
|
import json as json_module
|
|
26
27
|
import math
|
|
27
28
|
import os
|
|
@@ -4966,11 +4967,14 @@ class Client:
|
|
|
4966
4967
|
async def query_workflow(
|
|
4967
4968
|
self, workflow_id: str, query_name: str, *, args: list[Any] | None = None
|
|
4968
4969
|
) -> Any:
|
|
4969
|
-
"""Execute a named read-only query
|
|
4970
|
+
"""Execute a named read-only query and return the Server's receipt.
|
|
4970
4971
|
|
|
4971
4972
|
Queries are synchronous and non-mutating. The server runs the named
|
|
4972
|
-
query handler inside the workflow process
|
|
4973
|
-
|
|
4973
|
+
query handler inside the workflow process. The returned ``dict``
|
|
4974
|
+
includes workflow/run identities and ``query_name``; its ``result``
|
|
4975
|
+
member holds the decoded handler value, which may be ``None``.
|
|
4976
|
+
Read ``receipt["result"]`` to obtain that value.
|
|
4977
|
+
Raises :class:`~durable_workflow.errors.QueryFailed` if the
|
|
4974
4978
|
query was rejected, the handler errored, or the original query timed
|
|
4975
4979
|
out. A canonical query timeout is surfaced without automatically
|
|
4976
4980
|
admitting another query.
|
|
@@ -6609,7 +6613,6 @@ class Client:
|
|
|
6609
6613
|
body: dict[str, Any] = {
|
|
6610
6614
|
"lease_owner": lease_owner,
|
|
6611
6615
|
"query_task_attempt": query_task_attempt,
|
|
6612
|
-
"result": result,
|
|
6613
6616
|
"result_envelope": self._payload_envelope(
|
|
6614
6617
|
result,
|
|
6615
6618
|
codec=codec,
|
|
@@ -6621,6 +6624,14 @@ class Client:
|
|
|
6621
6624
|
external_storage_threshold_bytes=external_storage_threshold_bytes,
|
|
6622
6625
|
),
|
|
6623
6626
|
}
|
|
6627
|
+
# The envelope is authoritative. The optional plain projection must
|
|
6628
|
+
# not impose a JSON-only restriction on valid Avro values such as bytes.
|
|
6629
|
+
try:
|
|
6630
|
+
json.dumps(result, allow_nan=False)
|
|
6631
|
+
except (TypeError, ValueError):
|
|
6632
|
+
pass
|
|
6633
|
+
else:
|
|
6634
|
+
body["result"] = result
|
|
6624
6635
|
return await self._request(
|
|
6625
6636
|
"POST", f"/worker/query-tasks/{query_task_id}/complete", worker=True, json=body
|
|
6626
6637
|
)
|
|
@@ -970,6 +970,38 @@ class WorkflowCancelled(BaseException):
|
|
|
970
970
|
self.context = context
|
|
971
971
|
|
|
972
972
|
|
|
973
|
+
class WorkflowTimeoutCleanupRequested(WorkflowCancelled):
|
|
974
|
+
"""The run's work deadline passed and its timeout cleanup has started.
|
|
975
|
+
|
|
976
|
+
Raised at the authored call, like a cooperative cancellation request, when a
|
|
977
|
+
run that opted in to timeout cleanup reaches its work deadline. It is a
|
|
978
|
+
:class:`WorkflowCancelled`, so existing ``except WorkflowCancelled:``
|
|
979
|
+
handlers (saga compensation, cleanup) run unchanged. The run still ends
|
|
980
|
+
timed out, whatever the cleanup returns.
|
|
981
|
+
|
|
982
|
+
Like :class:`WorkflowCancelled` it is :class:`BaseException`-rooted, and it
|
|
983
|
+
is not an :class:`asyncio.CancelledError`. ``context.cause`` is
|
|
984
|
+
``"timeout"``; test ``cause`` rather than the type when telling the two
|
|
985
|
+
apart, since ``cause`` is the cross-SDK discriminator. ``context.cleanup_deadline_at``
|
|
986
|
+
is the cleanup deadline. Experimental.
|
|
987
|
+
"""
|
|
988
|
+
|
|
989
|
+
def __init__(
|
|
990
|
+
self, message: str = "workflow work deadline passed: timeout cleanup requested", *,
|
|
991
|
+
request_id: str | None = None, context: CancellationContext | ScopedCancellationContext | None = None,
|
|
992
|
+
) -> None:
|
|
993
|
+
super().__init__(message, request_id=request_id, context=context)
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
def _cancellation_requested(
|
|
997
|
+
message: str, *, request_id: str | None, context: CancellationContext | ScopedCancellationContext | None,
|
|
998
|
+
) -> WorkflowCancelled:
|
|
999
|
+
"""The exception for a delivered run request: the timeout subtype when timeout cleanup requested it."""
|
|
1000
|
+
if isinstance(context, CancellationContext) and context.is_timeout:
|
|
1001
|
+
return WorkflowTimeoutCleanupRequested(request_id=request_id, context=context)
|
|
1002
|
+
return WorkflowCancelled(message, request_id=request_id, context=context)
|
|
1003
|
+
|
|
1004
|
+
|
|
973
1005
|
class ActivityCancelled(BaseException):
|
|
974
1006
|
"""An in-flight activity was cancelled.
|
|
975
1007
|
|
|
@@ -343,6 +343,19 @@ class BusinessReplayClock:
|
|
|
343
343
|
events.append(event)
|
|
344
344
|
self._pending = (None, _activity_group_time(events, failed_member))
|
|
345
345
|
|
|
346
|
+
def observe_propagated_activity_failure(self, member: _GroupMember, *, reconstruction: bool) -> None:
|
|
347
|
+
"""Use only the qualified first-recorded failure of an explicit group."""
|
|
348
|
+
self._pending = (None, None)
|
|
349
|
+
if reconstruction:
|
|
350
|
+
return
|
|
351
|
+
event = self._activity_group_boundary(member)
|
|
352
|
+
if event is None or _kind(event) == "ActivityCompleted":
|
|
353
|
+
return
|
|
354
|
+
time = _group_event_time(event)
|
|
355
|
+
milliseconds = canonical_milliseconds(time) if time is not None else None
|
|
356
|
+
if milliseconds is not None:
|
|
357
|
+
self._pending = (member[0], from_canonical_milliseconds(milliseconds))
|
|
358
|
+
|
|
346
359
|
def _activity_group_boundary(self, member: _GroupMember) -> Mapping[str, Any] | None:
|
|
347
360
|
index, sequence, activity_type, path = member
|
|
348
361
|
indices = self._by_sequence.get(sequence, [])
|
|
@@ -74,6 +74,7 @@ from .errors import (
|
|
|
74
74
|
WorkflowCancelled,
|
|
75
75
|
WorkflowEntryArgumentsMismatchError,
|
|
76
76
|
WorkflowPayloadDecodeError,
|
|
77
|
+
_cancellation_requested,
|
|
77
78
|
)
|
|
78
79
|
from .external_storage import ExternalPayloadCache, ExternalStorageDriver
|
|
79
80
|
from .nexus import NexusOperationResult, stable_nexus_idempotency_key
|
|
@@ -2359,7 +2360,7 @@ class WorkflowContext:
|
|
|
2359
2360
|
def throw_if_cancellation_requested(self) -> None:
|
|
2360
2361
|
"""Raise :class:`WorkflowCancelled` at an explicit safe point."""
|
|
2361
2362
|
if self._cancel_requested and self._cancellation_shield_depth == 0:
|
|
2362
|
-
raise
|
|
2363
|
+
raise _cancellation_requested(
|
|
2363
2364
|
"workflow cancellation was requested", request_id=self._cancellation_request_id,
|
|
2364
2365
|
context=self._cancellation_context,
|
|
2365
2366
|
)
|
|
@@ -4025,6 +4026,101 @@ def _parallel_group_entry(payload: Mapping[str, Any]) -> tuple[str, str, int, in
|
|
|
4025
4026
|
return group_id, kind, base_sequence, size, index
|
|
4026
4027
|
|
|
4027
4028
|
|
|
4029
|
+
def _parallel_policy_frames(payload: Mapping[str, Any]) -> tuple[list[Any], bool]:
|
|
4030
|
+
path = payload.get("parallel_group_path")
|
|
4031
|
+
frames = path if isinstance(path, list) and path else [payload]
|
|
4032
|
+
has_explicit = "parallel_group_policy" in payload or any(
|
|
4033
|
+
isinstance(frame, Mapping) and "parallel_group_policy" in frame for frame in frames
|
|
4034
|
+
)
|
|
4035
|
+
if has_explicit and path is not None and not isinstance(path, list):
|
|
4036
|
+
raise ValueError("parallel_group_policy requires a canonical group path")
|
|
4037
|
+
if isinstance(path, list) and path:
|
|
4038
|
+
_assert_parallel_policy_alias(payload, path[-1], has_explicit)
|
|
4039
|
+
return frames, has_explicit
|
|
4040
|
+
|
|
4041
|
+
|
|
4042
|
+
def _assert_parallel_policy_alias(payload: Mapping[str, Any], inner: Any, has_explicit: bool) -> None:
|
|
4043
|
+
if not isinstance(inner, Mapping):
|
|
4044
|
+
if has_explicit:
|
|
4045
|
+
raise ValueError("parallel_group_policy requires matching flattened group identity")
|
|
4046
|
+
return
|
|
4047
|
+
if (("parallel_group_policy" in payload) != ("parallel_group_policy" in inner)
|
|
4048
|
+
or payload.get("parallel_group_policy") != inner.get("parallel_group_policy")):
|
|
4049
|
+
raise ValueError("parallel_group_policy disagrees with its canonical path")
|
|
4050
|
+
if has_explicit and _parallel_group_entry(payload) != _parallel_group_entry(inner):
|
|
4051
|
+
raise ValueError("parallel_group_policy requires matching flattened group identity")
|
|
4052
|
+
|
|
4053
|
+
|
|
4054
|
+
def _parallel_policy_value(frame: Mapping[str, Any]) -> str | None:
|
|
4055
|
+
if "parallel_group_policy" not in frame:
|
|
4056
|
+
return None
|
|
4057
|
+
policy = frame["parallel_group_policy"]
|
|
4058
|
+
if not isinstance(policy, str) or policy not in {"propagate", "cancel_remaining", "settle"}:
|
|
4059
|
+
raise ValueError("parallel_group_policy is unknown or malformed")
|
|
4060
|
+
if frame.get("parallel_group_mode") == "select":
|
|
4061
|
+
raise ValueError("parallel_group_policy does not apply to select frames")
|
|
4062
|
+
return policy
|
|
4063
|
+
|
|
4064
|
+
|
|
4065
|
+
def _parallel_policy_entry(
|
|
4066
|
+
frame: Any, *, strict: bool,
|
|
4067
|
+
) -> tuple[tuple[str, str, int, int], str | None] | None:
|
|
4068
|
+
if not isinstance(frame, Mapping):
|
|
4069
|
+
if strict:
|
|
4070
|
+
raise ValueError("parallel_group_policy requires canonical group metadata")
|
|
4071
|
+
return None
|
|
4072
|
+
policy = _parallel_policy_value(frame)
|
|
4073
|
+
if frame.get("parallel_group_mode") == "select":
|
|
4074
|
+
return None
|
|
4075
|
+
entry = _parallel_group_entry(frame)
|
|
4076
|
+
if entry is None:
|
|
4077
|
+
if strict:
|
|
4078
|
+
raise ValueError("parallel_group_policy requires canonical group metadata")
|
|
4079
|
+
return None
|
|
4080
|
+
return entry[:4], policy
|
|
4081
|
+
|
|
4082
|
+
|
|
4083
|
+
def _merge_parallel_group_policies(
|
|
4084
|
+
payload: Mapping[str, Any], policies: dict[tuple[str, str, int, int], str | None],
|
|
4085
|
+
) -> None:
|
|
4086
|
+
frames, has_explicit = _parallel_policy_frames(payload)
|
|
4087
|
+
ordinary_policies: list[str | None] = []
|
|
4088
|
+
for frame in frames:
|
|
4089
|
+
parsed = _parallel_policy_entry(frame, strict=has_explicit)
|
|
4090
|
+
if parsed is None:
|
|
4091
|
+
continue
|
|
4092
|
+
key, recorded = parsed
|
|
4093
|
+
ordinary_policies.append(recorded)
|
|
4094
|
+
if key in policies and policies[key] != recorded:
|
|
4095
|
+
raise ValueError("parallel_group_policy is inconsistent across members or history")
|
|
4096
|
+
policies[key] = recorded
|
|
4097
|
+
if has_explicit and None in ordinary_policies:
|
|
4098
|
+
raise LocalActivityExecutionAborted("parallel_group_policy mixed nested composition is not supported")
|
|
4099
|
+
|
|
4100
|
+
|
|
4101
|
+
def _read_parallel_group_policies(
|
|
4102
|
+
events: list[dict[str, Any]], supported: tuple[str, ...],
|
|
4103
|
+
) -> dict[tuple[str, str, int, int], str | None]:
|
|
4104
|
+
"""Validate recorded policy before application code can observe the history.
|
|
4105
|
+
|
|
4106
|
+
This draft consumer has no worker negotiation or advertisement. The private
|
|
4107
|
+
replay option enables source tests only until producer admission is qualified.
|
|
4108
|
+
"""
|
|
4109
|
+
if any(policy != "propagate" for policy in supported):
|
|
4110
|
+
raise ValueError("parallel_group_policy consumer is not implemented")
|
|
4111
|
+
policies: dict[tuple[str, str, int, int], str | None] = {}
|
|
4112
|
+
for event in events:
|
|
4113
|
+
payload = event.get("payload")
|
|
4114
|
+
if not isinstance(payload, Mapping):
|
|
4115
|
+
continue
|
|
4116
|
+
_merge_parallel_group_policies(payload, policies)
|
|
4117
|
+
if any(policy is not None and policy not in supported for policy in policies.values()):
|
|
4118
|
+
raise LocalActivityExecutionAborted(
|
|
4119
|
+
"parallel_group_policy_not_supported: explicit history requires a qualified policy consumer",
|
|
4120
|
+
)
|
|
4121
|
+
return policies
|
|
4122
|
+
|
|
4123
|
+
|
|
4028
4124
|
def _selection_group_metadata(payload: Mapping[str, Any]) -> Mapping[str, Any] | None:
|
|
4029
4125
|
"""Return the outer durable-selection metadata entry, if present."""
|
|
4030
4126
|
raw_path = payload.get("parallel_group_path")
|
|
@@ -4863,6 +4959,7 @@ def _replay_state(
|
|
|
4863
4959
|
reconstruction_only: bool = False,
|
|
4864
4960
|
allow_cancellation_scope_authoring: bool = False,
|
|
4865
4961
|
allow_cancellation_scope_delivery: bool = False,
|
|
4962
|
+
parallel_group_policies: tuple[str, ...] = (),
|
|
4866
4963
|
) -> _ReplayState:
|
|
4867
4964
|
_validate_workflow_entrypoint(workflow_cls)
|
|
4868
4965
|
_workflow_handler_registries(workflow_cls)
|
|
@@ -4882,10 +4979,16 @@ def _replay_state(
|
|
|
4882
4979
|
exception_type=type(exception).__name__,
|
|
4883
4980
|
) from exception
|
|
4884
4981
|
|
|
4982
|
+
# Retained metadata still requires a qualified consumer when its event is
|
|
4983
|
+
# excluded from semantic outcomes, including run-close settlements.
|
|
4984
|
+
retained_events = list(history_events)
|
|
4985
|
+
recorded_group_policies = _read_parallel_group_policies(retained_events, parallel_group_policies)
|
|
4885
4986
|
# A run-close cancellation never resolves a select() member, never fails
|
|
4886
4987
|
# an all() group and never supplies replay time: the workflow had closed
|
|
4887
4988
|
# past it. Every history reader below sees the activity as still open.
|
|
4888
|
-
events = [event for event in
|
|
4989
|
+
events = [event for event in retained_events if not _settled_at_close(event)]
|
|
4990
|
+
if len(events) != len(retained_events):
|
|
4991
|
+
recorded_group_policies = _read_parallel_group_policies(events, parallel_group_policies)
|
|
4889
4992
|
# A malformed delivery span refuses replay before any history parser can
|
|
4890
4993
|
# read it more permissively.
|
|
4891
4994
|
_assert_delivery_spans(events)
|
|
@@ -5311,7 +5414,11 @@ def _replay_state(
|
|
|
5311
5414
|
_append_selection_step(shape, event, fallback_sequence=workflow_sequence)
|
|
5312
5415
|
return
|
|
5313
5416
|
resolved_results.append(value)
|
|
5314
|
-
resolved_parallel_members.append(
|
|
5417
|
+
resolved_parallel_members.append(
|
|
5418
|
+
None if any(frame.get("parallel_group_policy") is not None
|
|
5419
|
+
for frame in (payload.get("parallel_group_path") or []) if isinstance(frame, Mapping))
|
|
5420
|
+
or payload.get("parallel_group_policy") is not None else _parallel_group_member(payload)
|
|
5421
|
+
)
|
|
5315
5422
|
recorded_steps.append(step)
|
|
5316
5423
|
|
|
5317
5424
|
def _recorded_step(
|
|
@@ -5455,7 +5562,8 @@ def _replay_state(
|
|
|
5455
5562
|
candidates.extend(recorded_wait_steps[wait_yield_count:])
|
|
5456
5563
|
if pending_step_cursor < len(recorded_pending_steps):
|
|
5457
5564
|
candidates.extend(recorded_pending_steps[pending_step_cursor:])
|
|
5458
|
-
return sorted(
|
|
5565
|
+
return sorted((step for step in candidates if step.workflow_sequence not in consumed_policy_sequences),
|
|
5566
|
+
key=lambda step: step.workflow_sequence)
|
|
5459
5567
|
|
|
5460
5568
|
def _next_unconsumed_recorded_step() -> _RecordedStep | None:
|
|
5461
5569
|
candidates = _unconsumed_recorded_steps()
|
|
@@ -6178,6 +6286,7 @@ def _replay_state(
|
|
|
6178
6286
|
)
|
|
6179
6287
|
|
|
6180
6288
|
result_cursor = 0
|
|
6289
|
+
consumed_policy_sequences: set[int] = set()
|
|
6181
6290
|
pending_step_cursor = 0
|
|
6182
6291
|
wait_yield_count = 0
|
|
6183
6292
|
has_terminal_history = any(_history_event_type(event) in {
|
|
@@ -6380,13 +6489,25 @@ def _replay_state(
|
|
|
6380
6489
|
"condition": "parallel-conditions",
|
|
6381
6490
|
"mixed": "parallel-calls",
|
|
6382
6491
|
}[kind]
|
|
6383
|
-
|
|
6492
|
+
entry: dict[str, Any] = {
|
|
6384
6493
|
"parallel_group_id": f"{prefix}:{base_sequence}:{size}",
|
|
6385
6494
|
"parallel_group_kind": kind,
|
|
6386
6495
|
"parallel_group_base_sequence": base_sequence,
|
|
6387
6496
|
"parallel_group_size": size,
|
|
6388
6497
|
"parallel_group_index": index,
|
|
6389
6498
|
}
|
|
6499
|
+
key = (entry["parallel_group_id"], kind, base_sequence, size)
|
|
6500
|
+
if key in recorded_group_policies:
|
|
6501
|
+
policy = recorded_group_policies[key]
|
|
6502
|
+
elif any(base_sequence <= step.workflow_sequence < base_sequence + size
|
|
6503
|
+
for step in recorded_steps + recorded_wait_steps + recorded_pending_steps):
|
|
6504
|
+
# Histories predating group metadata also keep their recorded semantics.
|
|
6505
|
+
policy = None
|
|
6506
|
+
else:
|
|
6507
|
+
policy = "propagate" if "propagate" in parallel_group_policies else None
|
|
6508
|
+
if policy is not None:
|
|
6509
|
+
entry["parallel_group_policy"] = policy
|
|
6510
|
+
return entry
|
|
6390
6511
|
|
|
6391
6512
|
def _annotate_parallel_commands(
|
|
6392
6513
|
commands: list[Any],
|
|
@@ -6406,7 +6527,7 @@ def _replay_state(
|
|
|
6406
6527
|
recorded_sequences = [
|
|
6407
6528
|
step.workflow_sequence for step in recorded_steps + recorded_wait_steps + recorded_pending_steps
|
|
6408
6529
|
]
|
|
6409
|
-
base_sequence = max(recorded_sequences, default=0) + len(pending) + 1
|
|
6530
|
+
base_sequence = max([*recorded_sequences, *consumed_policy_sequences], default=0) + len(pending) + 1
|
|
6410
6531
|
|
|
6411
6532
|
def _build(group: list[Any], group_base: int) -> tuple[list[Any], list[Any]]:
|
|
6412
6533
|
size = len(_parallel_leaves(group, nested=group is not commands))
|
|
@@ -7161,7 +7282,7 @@ def _replay_state(
|
|
|
7161
7282
|
authored_sequence += 1
|
|
7162
7283
|
try:
|
|
7163
7284
|
_refresh_replay_logging()
|
|
7164
|
-
advanced_cmd = _resume_business(gen.throw,
|
|
7285
|
+
advanced_cmd = _resume_business(gen.throw, _cancellation_requested(
|
|
7165
7286
|
"workflow cancellation was requested", request_id=boundary.request_id,
|
|
7166
7287
|
context=ctx._cancellation_context,
|
|
7167
7288
|
))
|
|
@@ -7287,6 +7408,43 @@ def _replay_state(
|
|
|
7287
7408
|
except StopIteration as stop:
|
|
7288
7409
|
return _terminal_state(stop.value, include_pending=True)
|
|
7289
7410
|
|
|
7411
|
+
def _consume_propagating_group(
|
|
7412
|
+
commands: list[Any],
|
|
7413
|
+
) -> tuple[list[Any], list[_RecordedStep], ActivityFailed | ChildWorkflowFailed | None] | None:
|
|
7414
|
+
base = commands[0]._parallel_group_path[0]["parallel_group_base_sequence"]
|
|
7415
|
+
slots = [index for index in range(result_cursor, len(recorded_steps))
|
|
7416
|
+
if base <= recorded_steps[index].workflow_sequence < base + len(commands)]
|
|
7417
|
+
if len({recorded_steps[index].workflow_sequence for index in slots}) != len(slots):
|
|
7418
|
+
raise ValueError("parallel_group_policy history has duplicate member outcomes")
|
|
7419
|
+
for index in slots:
|
|
7420
|
+
_assert_step_matches(commands[recorded_steps[index].workflow_sequence - base], recorded_steps[index])
|
|
7421
|
+
failures = [index for index in slots
|
|
7422
|
+
if isinstance(resolved_results[index], ActivityFailed | ChildWorkflowFailed)]
|
|
7423
|
+
selected = min(failures, key=lambda index: cast(int, recorded_steps[index].history_index)) if failures else None
|
|
7424
|
+
if selected is None and len(slots) != len(commands):
|
|
7425
|
+
return None
|
|
7426
|
+
ordered = sorted(slots, key=lambda index: recorded_steps[index].workflow_sequence)
|
|
7427
|
+
values = [resolved_results[index] for index in ordered]
|
|
7428
|
+
steps = [recorded_steps[index] for index in ordered]
|
|
7429
|
+
failure = cast(ActivityFailed | ChildWorkflowFailed | None,
|
|
7430
|
+
resolved_results[selected] if selected is not None else None)
|
|
7431
|
+
boundary = (recorded_steps[selected].history_index if selected is not None
|
|
7432
|
+
else max(cast(int, step.history_index) for step in steps))
|
|
7433
|
+
while pending_receivers and pending_receivers[0].history_index < cast(int, boundary):
|
|
7434
|
+
if pending_receivers[0].condition_wait_id is not None:
|
|
7435
|
+
break
|
|
7436
|
+
_apply_receiver(pending_receivers.pop(0))
|
|
7437
|
+
# A late loser can settle on either side of successor work. Remove its
|
|
7438
|
+
# outcome by durable sequence so it never occupies the successor cursor.
|
|
7439
|
+
# Keep receiver positions relative to the remaining ordinary outcomes.
|
|
7440
|
+
for receiver in pending_receivers:
|
|
7441
|
+
receiver.result_index -= sum(index < receiver.result_index for index in slots)
|
|
7442
|
+
for index in sorted(slots, reverse=True):
|
|
7443
|
+
del resolved_results[index]
|
|
7444
|
+
del recorded_steps[index]
|
|
7445
|
+
consumed_policy_sequences.update(range(base, base + len(commands)))
|
|
7446
|
+
return values, steps, failure
|
|
7447
|
+
|
|
7290
7448
|
def _advance_selection_clock(base: int, size: int, failure: BaseException | None) -> None:
|
|
7291
7449
|
indexes = [
|
|
7292
7450
|
selection_resolution_indexes[sequence] for sequence in range(base, base + size)
|
|
@@ -7575,6 +7733,57 @@ def _replay_state(
|
|
|
7575
7733
|
prepared_group = prepare_local_activities and _contains_local_activity(cmd)
|
|
7576
7734
|
cmd, result_shape = _annotate_parallel_commands(cmd, current_call_sequence if prepared_group else None)
|
|
7577
7735
|
needed = len(cmd)
|
|
7736
|
+
if cmd and cmd[0]._parallel_group_path[0].get("parallel_group_policy") == "propagate":
|
|
7737
|
+
if prepared_group or any(isinstance(leaf, RecordLocalActivity) for leaf in cmd):
|
|
7738
|
+
raise LocalActivityExecutionAborted("parallel_group_policy requires qualified local admission")
|
|
7739
|
+
consumed = _consume_propagating_group(cmd)
|
|
7740
|
+
if consumed is None:
|
|
7741
|
+
_set_replaying(False)
|
|
7742
|
+
for offset, leaf in enumerate(cmd):
|
|
7743
|
+
_assert_pending_step_matches(leaf, offset)
|
|
7744
|
+
return _state([*pending, *cmd])
|
|
7745
|
+
vals, consumed_steps, failed = consumed
|
|
7746
|
+
if failed is not None:
|
|
7747
|
+
failed_step = next(step for step, value in zip(consumed_steps, vals, strict=True)
|
|
7748
|
+
if value is failed)
|
|
7749
|
+
_advance_cancellation_clock([failed_step.history_index])
|
|
7750
|
+
leaf = cmd[failed_step.workflow_sequence - cmd[0]._parallel_group_path[0][
|
|
7751
|
+
"parallel_group_base_sequence"]]
|
|
7752
|
+
if isinstance(leaf, ScheduleActivity):
|
|
7753
|
+
ctx._business_clock.observe_propagated_activity_failure(
|
|
7754
|
+
(failed_step.history_index, failed_step.workflow_sequence,
|
|
7755
|
+
leaf.activity_type, leaf._parallel_group_path), reconstruction=reconstruction_only,
|
|
7756
|
+
)
|
|
7757
|
+
else:
|
|
7758
|
+
ctx._business_clock.unavailable()
|
|
7759
|
+
try:
|
|
7760
|
+
_refresh_replay_logging()
|
|
7761
|
+
advanced_cmd = _resume_business(gen.throw, failed)
|
|
7762
|
+
continue
|
|
7763
|
+
except StopIteration as stop:
|
|
7764
|
+
return _terminal_state(stop.value, include_pending=False)
|
|
7765
|
+
_advance_cancellation_clock(step.history_index for step in consumed_steps)
|
|
7766
|
+
try:
|
|
7767
|
+
typed_values = [_typed_activity_result(leaf, value)
|
|
7768
|
+
for leaf, value in zip(cmd, vals, strict=True)]
|
|
7769
|
+
except TypedValueError as error:
|
|
7770
|
+
ctx._business_clock.unavailable()
|
|
7771
|
+
try:
|
|
7772
|
+
_refresh_replay_logging()
|
|
7773
|
+
advanced_cmd = _resume_business(gen.throw, error)
|
|
7774
|
+
continue
|
|
7775
|
+
except StopIteration as stop:
|
|
7776
|
+
return _terminal_state(stop.value, include_pending=False)
|
|
7777
|
+
if all(isinstance(leaf, ScheduleActivity) for leaf in cmd):
|
|
7778
|
+
ctx._business_clock.observe_activity_group(
|
|
7779
|
+
[(step.history_index, step.workflow_sequence, leaf.activity_type, leaf._parallel_group_path)
|
|
7780
|
+
for step, leaf in zip(consumed_steps, cmd, strict=True)],
|
|
7781
|
+
None, reconstruction=reconstruction_only,
|
|
7782
|
+
)
|
|
7783
|
+
else:
|
|
7784
|
+
ctx._business_clock.unavailable()
|
|
7785
|
+
next_value = _parallel_result_shape(result_shape, typed_values)
|
|
7786
|
+
continue
|
|
7578
7787
|
if prepared_group:
|
|
7579
7788
|
group = _prepared_group(cmd)
|
|
7580
7789
|
if group is not None:
|
{durable_workflow-2.17.1 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/SOURCES.txt
RENAMED
|
@@ -71,6 +71,7 @@ tests/test_business_replay_clock_child.py
|
|
|
71
71
|
tests/test_business_replay_clock_parallel.py
|
|
72
72
|
tests/test_business_replay_clock_redrive.py
|
|
73
73
|
tests/test_business_replay_clock_sequence_claims.py
|
|
74
|
+
tests/test_cancellation_cause.py
|
|
74
75
|
tests/test_cancellation_context.py
|
|
75
76
|
tests/test_cancellation_remaining_time.py
|
|
76
77
|
tests/test_cancellation_scope_admission.py
|
|
@@ -124,6 +125,7 @@ tests/test_nexus_namespace.py
|
|
|
124
125
|
tests/test_nexus_wire.py
|
|
125
126
|
tests/test_order_processing_example.py
|
|
126
127
|
tests/test_parallel_completion_order_replay.py
|
|
128
|
+
tests/test_parallel_group_policy.py
|
|
127
129
|
tests/test_parallel_saga_authoring.py
|
|
128
130
|
tests/test_patch_history.py
|
|
129
131
|
tests/test_pending_operation_replay.py
|
|
@@ -147,6 +149,7 @@ tests/test_redrive_replay.py
|
|
|
147
149
|
tests/test_redrive_successor_evidence.py
|
|
148
150
|
tests/test_registration_ambiguity.py
|
|
149
151
|
tests/test_release_metadata.py
|
|
152
|
+
tests/test_release_promotion.py
|
|
150
153
|
tests/test_replay.py
|
|
151
154
|
tests/test_replay_clock.py
|
|
152
155
|
tests/test_replay_conformance.py
|