durable-workflow 2.19.0__tar.gz → 2.20.0__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.19.0/src/durable_workflow.egg-info → durable_workflow-2.20.0}/PKG-INFO +1 -1
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/pyproject.toml +3 -3
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/__init__.py +8 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/client.py +149 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/errors.py +60 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/replay_clock.py +15 -1
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/sync.py +21 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/worker.py +39 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/workflow.py +252 -2
- {durable_workflow-2.19.0 → durable_workflow-2.20.0/src/durable_workflow.egg-info}/PKG-INFO +1 -1
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow.egg-info/SOURCES.txt +2 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_retry_cap_cell.py +1 -1
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_business_replay_clock.py +41 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_replay_regression_corpus.py +6 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_search_attribute_replay_identity.py +2 -0
- durable_workflow-2.20.0/tests/test_signal_external_workflow.py +381 -0
- durable_workflow-2.20.0/tests/test_signal_with_start.py +231 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/LICENSE +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/README.md +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/setup.cfg +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_activity_checkpoint.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_activity_lease.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_activity_process.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_avro.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_cancellation_scope.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_cancellation_scope_history.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_condition_fingerprint.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_cooperative_cancellation.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_failure_reporting.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_metric_routes.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_poll_transport.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_prepared_local_activity.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_query_task_authority.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_sticky_workflow_cache.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/_typed_values.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/activity.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/auth_composition.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/cancellation.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/external_storage.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/external_task_input.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/external_task_result.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/history_bundle_verify.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/interceptors.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/invocable.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/metrics.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/nexus.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/py.typed +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/python_conformance.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/replay_clock_math.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/replay_conformance.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/replay_verify.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/retry_policy.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/serializer.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/server_compatibility.json +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/telemetry.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/telemetry_carrier.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/testing.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/worker_session.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/worker_status.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow/workflow_updates_conformance.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow.egg-info/dependency_links.txt +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow.egg-info/entry_points.txt +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow.egg-info/requires.txt +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/src/durable_workflow.egg-info/top_level.txt +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_acceptance_authority.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_acceptance_consumer.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_acceptance_entry.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_cancellation_policies.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_checkpoint.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_context.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_exponential_retry.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_heartbeat_authority.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_identity.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_install_inventory.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_lease_authority.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_lease_renewal.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_lease_worker.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_process.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_retry_info.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_activity_run_closed_refusal.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_auth_composition.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_avro_value_benchmark.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_avro_value_protocol.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_business_replay_clock_child.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_business_replay_clock_parallel.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_business_replay_clock_redrive.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_business_replay_clock_sequence_claims.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cancellation_cause.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cancellation_context.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cancellation_remaining_time.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cancellation_scope_admission.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cancellation_scope_authoring.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cancellation_scope_boundary.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cancellation_scope_opening.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_checkpointed_batch_example.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_child_workflow_policies.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_ci_checkout.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_ci_integration_endpoint.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_client.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_client_iterators.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_client_telemetry.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_client_timeouts.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_codec_regression_corpus.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_command_keys_acceptance.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_command_keys_captured_inputs.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_command_keys_container_ownership.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_command_keys_workspace.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_committed_cancellation_scope_descendants.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_committed_cancellation_scope_groups.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_committed_cancellation_scope_history.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_committed_cancellation_scope_replay.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_completion_size_limit.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_condition_fingerprint.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_condition_occurrence_id.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_condition_replay_drift.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_control_plane_parity_fixtures.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cooperative_cancellation.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cooperative_cancellation_client.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cooperative_cancellation_worker.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_cooperative_remote_worker.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_docs_release_channel.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_docstring_cross_references.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_durable_selection.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_empty_callback_failure.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_errors.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_external_storage.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_external_task_input.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_external_task_result.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_failure_reporting.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_generator_lifecycle.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_golden_history_replay.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_history_bundle_pruned.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_history_bundle_schema2.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_history_bundle_verify.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_history_event_contract.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_invocable.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_local_activity_backoff.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_local_failure_reporting.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_message_streams.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_metric_routes.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_metrics.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_native_timer_redrive_cell.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_native_timer_redrive_clock.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_nexus_durable_wait.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_nexus_namespace.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_nexus_wire.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_order_processing_example.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_parallel_completion_order_replay.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_parallel_group_policy.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_parallel_member_failure_open_siblings.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_parallel_saga_authoring.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_patch_history.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_pending_operation_replay.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_physical_command_key_readback.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_poll_failure_backoff.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_poll_transport.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_portal_source_split.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_prepared_local_activity_client.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_prepared_local_activity_groups.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_prepared_local_activity_policies.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_prepared_local_activity_worker.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_public_boundary_scanner.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_publish_workflow_isolation.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_published_activity_acceptance.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_published_pagination_evidence.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_pypi_project_surface.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_python_conformance.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_queries.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_query_task_authority.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_query_timeout_retry.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_quiesced_snapshot.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_readme_quickstart.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_redrive_call_ledger.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_redrive_replay.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_redrive_successor_evidence.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_registration_ambiguity.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_release_metadata.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_release_promotion.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_replay.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_replay_clock.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_replay_conformance.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_replay_verify.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_retry_cap_download.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_retry_cap_workflow.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_retry_policy.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_run_activities.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_run_cancellation_scope_replay.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_run_closed_settlement_replay.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_runtime_external_payload_transport.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_schedule_origin.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_schedules.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_scoped_run_cancellation_context.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_sdk_metrics_contract.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_serializer.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_signals.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_sleep.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_standalone_activity_client.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_static_credential_validation.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_sticky_execution.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_sticky_history_suffix.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_storage_admission.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_sync.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_sync_activities.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_synthetic_command_key_readback.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_telemetry.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_telemetry_carrier.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_testing_failures.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_testing_harness.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_testing_nexus.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_threaded_heartbeat_example.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_tls_trust.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_transport_diagnostics.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_typed_values.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_typed_workflow_values.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_update_outcome.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_update_signal_condition_replay.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_updates.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_wait_condition.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker_deregistration.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker_observation.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker_session.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker_startup_buffered.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker_startup_raw.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker_startup_read_budget.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker_startup_snapshot.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker_status.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_worker_telemetry_wire.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_workflow_entry_arguments.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_workflow_entrypoint_validation.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_workflow_handler_validation.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_workflow_identity.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_workflow_result_timeout.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/tests/test_workflow_streams.py +0 -0
- {durable_workflow-2.19.0 → durable_workflow-2.20.0}/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.20.0"
|
|
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.20.0"
|
|
83
|
+
registry-version = "2.20.0"
|
|
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"
|
|
@@ -88,6 +88,7 @@ from .errors import (
|
|
|
88
88
|
ExternalPayloadUnsupported,
|
|
89
89
|
FailureReportTooLarge,
|
|
90
90
|
InvalidArgument,
|
|
91
|
+
InvalidSignalName,
|
|
91
92
|
InvalidWorkflowDefinition,
|
|
92
93
|
NamespaceNotFound,
|
|
93
94
|
NexusOperationFailed,
|
|
@@ -104,6 +105,7 @@ from .errors import (
|
|
|
104
105
|
ScheduleNotFound,
|
|
105
106
|
ServerError,
|
|
106
107
|
SignalFailed,
|
|
108
|
+
SignalWithStartFailed,
|
|
107
109
|
TypedValueError,
|
|
108
110
|
Unauthorized,
|
|
109
111
|
UnrecognizedUpdateOutcome,
|
|
@@ -244,6 +246,7 @@ from .workflow import (
|
|
|
244
246
|
ChildWorkflowRetryPolicy,
|
|
245
247
|
ContinueAsNew,
|
|
246
248
|
DurableOperationHandle,
|
|
249
|
+
ExternalSignalResult,
|
|
247
250
|
MessageStream,
|
|
248
251
|
MessageStreamMessage,
|
|
249
252
|
NexusServiceCall,
|
|
@@ -252,6 +255,7 @@ from .workflow import (
|
|
|
252
255
|
Saga,
|
|
253
256
|
ScheduleOrigin,
|
|
254
257
|
SelectionResult,
|
|
258
|
+
SignalExternalWorkflow,
|
|
255
259
|
StartChildWorkflow,
|
|
256
260
|
replay,
|
|
257
261
|
)
|
|
@@ -321,6 +325,7 @@ __all__ = [
|
|
|
321
325
|
"StandaloneActivityList",
|
|
322
326
|
"StoragePayloadTestResult",
|
|
323
327
|
"StorageTestResult",
|
|
328
|
+
"SignalExternalWorkflow",
|
|
324
329
|
"StartChildWorkflow",
|
|
325
330
|
"TaskQueueAdmission",
|
|
326
331
|
"TaskQueueBuildIdCohort",
|
|
@@ -401,6 +406,7 @@ __all__ = [
|
|
|
401
406
|
"NexusOperationFailed",
|
|
402
407
|
"NexusOperationResult",
|
|
403
408
|
"NexusServiceCall",
|
|
409
|
+
"ExternalSignalResult",
|
|
404
410
|
"NonDeterministicReplayError",
|
|
405
411
|
"ReplayClockUnavailable",
|
|
406
412
|
"DuplicateRegistrationError",
|
|
@@ -420,7 +426,9 @@ __all__ = [
|
|
|
420
426
|
"RetryPolicy",
|
|
421
427
|
"S3ExternalStorage",
|
|
422
428
|
"ServerError",
|
|
429
|
+
"InvalidSignalName",
|
|
423
430
|
"SignalFailed",
|
|
431
|
+
"SignalWithStartFailed",
|
|
424
432
|
"TransportRetryPolicy",
|
|
425
433
|
"Unauthorized",
|
|
426
434
|
"UnrecognizedUpdateOutcome",
|
|
@@ -129,6 +129,8 @@ CONTROL_PLANE_REQUEST_CONTRACT_VERSION = 1
|
|
|
129
129
|
_QUERY_TASKS_DISCOVERY_PATH = "worker_protocol.server_capabilities.query_tasks"
|
|
130
130
|
_COOPERATIVE_CANCELLATION_DISCOVERY_PATH = "worker_protocol.server_capabilities.cooperative_cancellation"
|
|
131
131
|
_UPDATE_OUTCOME_READS_DISCOVERY_PATH = "capabilities.update_outcome_reads"
|
|
132
|
+
_SIGNAL_WITH_START_DISCOVERY_PATH = "capabilities.signal_with_start"
|
|
133
|
+
_CLOSED_RUN_POLICIES = ("reject", "start_new_run")
|
|
132
134
|
_UPDATE_OUTCOME_WAIT_STAGES = ("accepted", "completed")
|
|
133
135
|
# Client-side headroom beyond a requested completion wait, so the HTTP timeout
|
|
134
136
|
# never cuts off a Server that is still legitimately waiting.
|
|
@@ -3247,6 +3249,27 @@ class Client:
|
|
|
3247
3249
|
),
|
|
3248
3250
|
)
|
|
3249
3251
|
|
|
3252
|
+
async def _require_signal_with_start(self) -> None:
|
|
3253
|
+
operation = "Client.signal_with_start"
|
|
3254
|
+
info = await self._runtime_discovery(
|
|
3255
|
+
operation=operation,
|
|
3256
|
+
required_path=_SIGNAL_WITH_START_DISCOVERY_PATH,
|
|
3257
|
+
)
|
|
3258
|
+
capabilities = info.get("capabilities")
|
|
3259
|
+
supported = capabilities.get("signal_with_start") if isinstance(capabilities, dict) else None
|
|
3260
|
+
if supported is not True:
|
|
3261
|
+
raise RuntimeCapabilityUnsupported(
|
|
3262
|
+
operation,
|
|
3263
|
+
_SIGNAL_WITH_START_DISCOVERY_PATH,
|
|
3264
|
+
(
|
|
3265
|
+
f"{operation} is unsupported by this runtime because GET /api/cluster/info "
|
|
3266
|
+
f"does not advertise {_SIGNAL_WITH_START_DISCOVERY_PATH}=true. Separate "
|
|
3267
|
+
"start_workflow(duplicate_policy='use-existing') and signal_workflow() calls "
|
|
3268
|
+
"are not atomic: the run can close between them and the signal is then refused. "
|
|
3269
|
+
"Upgrade to a native Server that serves signal-with-start."
|
|
3270
|
+
),
|
|
3271
|
+
)
|
|
3272
|
+
|
|
3250
3273
|
def get_workflow_handle(
|
|
3251
3274
|
self, workflow_id: str, *, run_id: str | None = None, workflow_type: str = ""
|
|
3252
3275
|
) -> WorkflowHandle:
|
|
@@ -4953,6 +4976,132 @@ class Client:
|
|
|
4953
4976
|
receipt.setdefault("request_id", key)
|
|
4954
4977
|
return receipt
|
|
4955
4978
|
|
|
4979
|
+
async def signal_with_start(
|
|
4980
|
+
self,
|
|
4981
|
+
workflow_id: str,
|
|
4982
|
+
signal_name: str,
|
|
4983
|
+
*,
|
|
4984
|
+
workflow_type: str,
|
|
4985
|
+
task_queue: str,
|
|
4986
|
+
input: list[Any] | None = None,
|
|
4987
|
+
signal_args: list[Any] | None = None,
|
|
4988
|
+
request_id: str | None = None,
|
|
4989
|
+
duplicate_policy: str | None = None,
|
|
4990
|
+
closed_run_policy: str | None = None,
|
|
4991
|
+
execution_timeout_seconds: int = 3600,
|
|
4992
|
+
run_timeout_seconds: int = 600,
|
|
4993
|
+
memo: dict[str, Any] | None = None,
|
|
4994
|
+
search_attributes: dict[str, Any] | None = None,
|
|
4995
|
+
business_key: str | None = None,
|
|
4996
|
+
priority: int | None = None,
|
|
4997
|
+
fairness_key: str | None = None,
|
|
4998
|
+
fairness_weight: int | None = None,
|
|
4999
|
+
) -> dict[str, Any]:
|
|
5000
|
+
"""Start the workflow or reuse its open run, and signal it, atomically.
|
|
5001
|
+
|
|
5002
|
+
One Server transaction either starts ``workflow_id`` (when it has no
|
|
5003
|
+
run) or reuses its open run, and records one ``signal_name`` signal on
|
|
5004
|
+
that run (native Server ``capabilities.signal_with_start``; the client
|
|
5005
|
+
checks discovery first and raises
|
|
5006
|
+
:class:`~durable_workflow.errors.RuntimeCapabilityUnsupported`
|
|
5007
|
+
otherwise). Unlike ``start_workflow(duplicate_policy="use-existing")``
|
|
5008
|
+
followed by ``signal_workflow()``, the run cannot close in between.
|
|
5009
|
+
|
|
5010
|
+
- No run: a new run starts with ``input`` and the start options, and
|
|
5011
|
+
the receipt has ``start_outcome == "started_new"``.
|
|
5012
|
+
- An open run (including the newest run after continue-as-new): the
|
|
5013
|
+
signal joins it and ``start_outcome == "returned_existing_active"``.
|
|
5014
|
+
Its input, deadlines and history are unchanged; ``input`` and the
|
|
5015
|
+
timeouts are not applied. ``duplicate_policy`` defaults to
|
|
5016
|
+
``"use-existing"``; ``"fail"`` refuses an open run with
|
|
5017
|
+
``reason == "instance_already_started"``.
|
|
5018
|
+
- A closed run: refused with ``reason == "run_not_active"`` unless
|
|
5019
|
+
``closed_run_policy="start_new_run"``, which starts a fresh run
|
|
5020
|
+
after it with this call's input and timeouts (the receipt names the
|
|
5021
|
+
closed run in ``closed_run_id``). The closed run keeps its outcome.
|
|
5022
|
+
|
|
5023
|
+
``workflow_type`` must be the instance's type and ``task_queue`` the
|
|
5024
|
+
open run's queue. ``signal_args`` are the signal's arguments, encoded
|
|
5025
|
+
like :meth:`signal_workflow`'s ``args``.
|
|
5026
|
+
|
|
5027
|
+
``request_id`` is the signal's command key (1-255 opaque,
|
|
5028
|
+
case-sensitive characters). When omitted the client generates
|
|
5029
|
+
``sdk-python-signal-with-start-<uuid>`` once per call, so a transport
|
|
5030
|
+
retry resends it. A retry with the same key, signal name, arguments
|
|
5031
|
+
and workflow type returns the original receipt with ``retained``
|
|
5032
|
+
``True``, even after the run closed or continued, and starts nothing.
|
|
5033
|
+
|
|
5034
|
+
Returns the Server's receipt: the signal's ``command_id``,
|
|
5035
|
+
``command_sequence``, ``run_id`` and ``outcome``, the start's
|
|
5036
|
+
``start_command_id``, ``start_outcome`` and ``start_command_status``,
|
|
5037
|
+
``intake_group_id`` and ``request_id``. Every refusal raises
|
|
5038
|
+
:class:`~durable_workflow.errors.SignalWithStartFailed` (a
|
|
5039
|
+
:class:`~durable_workflow.errors.SignalFailed`) with the Server's
|
|
5040
|
+
``reason`` and nothing written; a malformed request raises
|
|
5041
|
+
:class:`~durable_workflow.errors.InvalidArgument`. An admitted signal
|
|
5042
|
+
is admitted once; effects it triggers still need their own
|
|
5043
|
+
idempotency.
|
|
5044
|
+
"""
|
|
5045
|
+
if closed_run_policy is not None and closed_run_policy not in _CLOSED_RUN_POLICIES:
|
|
5046
|
+
raise ValueError("closed_run_policy must be 'reject' or 'start_new_run'")
|
|
5047
|
+
await self._require_signal_with_start()
|
|
5048
|
+
key = _command_request_id(request_id, "signal-with-start")
|
|
5049
|
+
body: dict[str, Any] = {
|
|
5050
|
+
"workflow_type": workflow_type,
|
|
5051
|
+
"task_queue": task_queue,
|
|
5052
|
+
"input": self._payload_envelope(
|
|
5053
|
+
input if input is not None else [],
|
|
5054
|
+
kind="workflow_input",
|
|
5055
|
+
workflow_id=workflow_id,
|
|
5056
|
+
task_queue=task_queue,
|
|
5057
|
+
),
|
|
5058
|
+
"execution_timeout_seconds": execution_timeout_seconds,
|
|
5059
|
+
"run_timeout_seconds": run_timeout_seconds,
|
|
5060
|
+
"request_id": key,
|
|
5061
|
+
}
|
|
5062
|
+
if signal_args:
|
|
5063
|
+
body["signal_input"] = self._payload_envelope(
|
|
5064
|
+
signal_args,
|
|
5065
|
+
kind="signal",
|
|
5066
|
+
workflow_id=workflow_id,
|
|
5067
|
+
signal_name=signal_name,
|
|
5068
|
+
)
|
|
5069
|
+
optional: dict[str, Any] = {
|
|
5070
|
+
"duplicate_policy": duplicate_policy,
|
|
5071
|
+
"closed_run_policy": closed_run_policy,
|
|
5072
|
+
"memo": memo,
|
|
5073
|
+
"business_key": business_key,
|
|
5074
|
+
"priority": priority,
|
|
5075
|
+
"fairness_key": fairness_key,
|
|
5076
|
+
"fairness_weight": fairness_weight,
|
|
5077
|
+
}
|
|
5078
|
+
body.update({field: value for field, value in optional.items() if value is not None})
|
|
5079
|
+
if search_attributes is not None:
|
|
5080
|
+
self._warn_json_payload_size(
|
|
5081
|
+
search_attributes,
|
|
5082
|
+
kind="search_attributes",
|
|
5083
|
+
workflow_id=workflow_id,
|
|
5084
|
+
task_queue=task_queue,
|
|
5085
|
+
)
|
|
5086
|
+
body["search_attributes"] = search_attributes
|
|
5087
|
+
path = (
|
|
5088
|
+
f"/workflows/{quote(workflow_id, safe='')}"
|
|
5089
|
+
f"/signal-with-start/{quote(signal_name, safe='')}"
|
|
5090
|
+
)
|
|
5091
|
+
try:
|
|
5092
|
+
data = await self._request(
|
|
5093
|
+
"POST", path,
|
|
5094
|
+
json=self._with_observability_context(body), context=workflow_id,
|
|
5095
|
+
)
|
|
5096
|
+
except Exception as exc:
|
|
5097
|
+
failure = _command_request_failure(exc, command="signal-with-start", request_id=key)
|
|
5098
|
+
if failure is exc:
|
|
5099
|
+
raise
|
|
5100
|
+
raise failure from exc
|
|
5101
|
+
receipt: dict[str, Any] = data if isinstance(data, dict) else {}
|
|
5102
|
+
receipt.setdefault("request_id", key)
|
|
5103
|
+
return receipt
|
|
5104
|
+
|
|
4956
5105
|
async def append_message_stream(
|
|
4957
5106
|
self,
|
|
4958
5107
|
workflow_id: str,
|
|
@@ -628,6 +628,35 @@ def _request_id_conflict_details(body: object) -> dict[str, Any]:
|
|
|
628
628
|
return {}
|
|
629
629
|
|
|
630
630
|
|
|
631
|
+
class InvalidSignalName(DurableWorkflowError, ValueError):
|
|
632
|
+
"""A signal name the Server would refuse, raised before anything is sent.
|
|
633
|
+
|
|
634
|
+
Signal names must be non-blank, at most 191 characters and 255 UTF-8
|
|
635
|
+
bytes, and free of control characters (code points below U+0020 and
|
|
636
|
+
U+007F). :attr:`reason` is ``"blank"``, ``"control_character"``,
|
|
637
|
+
``"too_many_characters"`` or ``"too_many_bytes"``. It is a
|
|
638
|
+
:class:`ValueError`, so existing ``except ValueError`` handlers catch it.
|
|
639
|
+
"""
|
|
640
|
+
|
|
641
|
+
def __init__(self, signal_name: object, reason: str, message: str) -> None:
|
|
642
|
+
super().__init__(f"invalid signal name ({reason}): {message}")
|
|
643
|
+
self.signal_name = signal_name
|
|
644
|
+
self.reason = reason
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
def validate_signal_name(signal_name: object) -> str:
|
|
648
|
+
"""Return ``signal_name`` if the Server accepts it, else raise :class:`InvalidSignalName`."""
|
|
649
|
+
if not isinstance(signal_name, str) or not signal_name.strip():
|
|
650
|
+
raise InvalidSignalName(signal_name, "blank", "a signal name must be a non-blank string")
|
|
651
|
+
if any(ord(character) < 0x20 or ord(character) == 0x7F for character in signal_name):
|
|
652
|
+
raise InvalidSignalName(signal_name, "control_character", "a signal name must not contain control characters")
|
|
653
|
+
if len(signal_name) > 191:
|
|
654
|
+
raise InvalidSignalName(signal_name, "too_many_characters", "a signal name must be at most 191 characters")
|
|
655
|
+
if len(signal_name.encode("utf-8")) > 255:
|
|
656
|
+
raise InvalidSignalName(signal_name, "too_many_bytes", "a signal name must be at most 255 UTF-8 bytes")
|
|
657
|
+
return signal_name
|
|
658
|
+
|
|
659
|
+
|
|
631
660
|
class SignalFailed(DurableWorkflowError):
|
|
632
661
|
"""A workflow signal was rejected before it could be delivered.
|
|
633
662
|
|
|
@@ -671,6 +700,23 @@ class SignalFailed(DurableWorkflowError):
|
|
|
671
700
|
return None
|
|
672
701
|
|
|
673
702
|
|
|
703
|
+
class SignalWithStartFailed(SignalFailed):
|
|
704
|
+
"""A signal-with-start intake was refused; nothing was started or signalled.
|
|
705
|
+
|
|
706
|
+
Raised by :meth:`Client.signal_with_start` for every refusal the Server
|
|
707
|
+
reports for the atomic intake (native Server
|
|
708
|
+
``capabilities.signal_with_start``). The refusal is atomic: no run was
|
|
709
|
+
started, no signal was recorded and no command key was reserved, so the
|
|
710
|
+
same call can be sent again once the cause is resolved. :attr:`reason`
|
|
711
|
+
names the cause, for example ``run_not_active`` (the current run is closed
|
|
712
|
+
and ``closed_run_policy`` was ``"reject"``), ``instance_already_started``
|
|
713
|
+
(an open run under ``duplicate_policy="fail"``), ``workflow_type_conflict``,
|
|
714
|
+
``task_queue_conflict``, ``workflow_id_reserved_in_namespace``,
|
|
715
|
+
``unknown_signal``, ``invalid_signal_arguments`` or ``request_id_conflict``.
|
|
716
|
+
It is a :class:`SignalFailed`, so existing signal handlers also catch it.
|
|
717
|
+
"""
|
|
718
|
+
|
|
719
|
+
|
|
674
720
|
class WorkflowPayloadDecodeError(DurableWorkflowError):
|
|
675
721
|
"""A committed workflow history payload could not be decoded during replay."""
|
|
676
722
|
|
|
@@ -1256,6 +1302,20 @@ def _raise_for_status(
|
|
|
1256
1302
|
"stale_update_validation_completion",
|
|
1257
1303
|
}
|
|
1258
1304
|
|
|
1305
|
+
if (
|
|
1306
|
+
operation == "signal_with_start"
|
|
1307
|
+
and status in (404, 409, 422)
|
|
1308
|
+
and isinstance(reason, str)
|
|
1309
|
+
and reason not in ("", "validation_failed")
|
|
1310
|
+
):
|
|
1311
|
+
# Every intake refusal is atomic; malformed requests stay InvalidArgument.
|
|
1312
|
+
raise SignalWithStartFailed(
|
|
1313
|
+
message or f"signal-with-start rejected: {reason}",
|
|
1314
|
+
reason=reason,
|
|
1315
|
+
status=status,
|
|
1316
|
+
body=body,
|
|
1317
|
+
)
|
|
1318
|
+
|
|
1259
1319
|
if status == 404:
|
|
1260
1320
|
if reason == "unknown_signal":
|
|
1261
1321
|
raise signal_failed("signal not found")
|
|
@@ -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
|
|
@@ -575,6 +575,27 @@ class Client:
|
|
|
575
575
|
)
|
|
576
576
|
return result
|
|
577
577
|
|
|
578
|
+
def signal_with_start(
|
|
579
|
+
self,
|
|
580
|
+
workflow_id: str,
|
|
581
|
+
signal_name: str,
|
|
582
|
+
*,
|
|
583
|
+
workflow_type: str,
|
|
584
|
+
task_queue: str,
|
|
585
|
+
**options: Any,
|
|
586
|
+
) -> dict[str, Any]:
|
|
587
|
+
"""Start or reuse the workflow's run and signal it atomically.
|
|
588
|
+
|
|
589
|
+
Takes the same keyword options as the async
|
|
590
|
+
:meth:`durable_workflow.client.Client.signal_with_start`.
|
|
591
|
+
"""
|
|
592
|
+
result: dict[str, Any] = self._runner.run(
|
|
593
|
+
self._async.signal_with_start(
|
|
594
|
+
workflow_id, signal_name, workflow_type=workflow_type, task_queue=task_queue, **options,
|
|
595
|
+
)
|
|
596
|
+
)
|
|
597
|
+
return result
|
|
598
|
+
|
|
578
599
|
def query_workflow(self, workflow_id: str, query_name: str, *, args: list[Any] | None = None) -> Any:
|
|
579
600
|
return self._runner.run(self._async.query_workflow(workflow_id, query_name, args=args))
|
|
580
601
|
|
|
@@ -127,6 +127,7 @@ from .workflow import (
|
|
|
127
127
|
RecordLocalActivity,
|
|
128
128
|
ReplayOutcome,
|
|
129
129
|
ScheduleActivity,
|
|
130
|
+
SignalExternalWorkflow,
|
|
130
131
|
StartChildWorkflow,
|
|
131
132
|
UpsertMemo,
|
|
132
133
|
_prepare_query_state,
|
|
@@ -1107,6 +1108,20 @@ def _server_supports_workflow_memo_updates(info: dict[str, Any]) -> bool:
|
|
|
1107
1108
|
)
|
|
1108
1109
|
|
|
1109
1110
|
|
|
1111
|
+
def _server_supports_signal_external_workflow(info: dict[str, Any]) -> bool:
|
|
1112
|
+
"""Whether the Server advertises the signal_external_workflow command (server#1134)."""
|
|
1113
|
+
worker_protocol = info.get("worker_protocol")
|
|
1114
|
+
if not isinstance(worker_protocol, dict):
|
|
1115
|
+
return False
|
|
1116
|
+
capabilities = worker_protocol.get("server_capabilities")
|
|
1117
|
+
if not isinstance(capabilities, dict) or capabilities.get("signal_external_workflow") is not True:
|
|
1118
|
+
return False
|
|
1119
|
+
supported_commands = capabilities.get("supported_workflow_task_commands")
|
|
1120
|
+
return supported_commands is None or (
|
|
1121
|
+
isinstance(supported_commands, list) and "signal_external_workflow" in supported_commands
|
|
1122
|
+
)
|
|
1123
|
+
|
|
1124
|
+
|
|
1110
1125
|
def _server_supports_update_validation_tasks(info: dict[str, Any]) -> bool:
|
|
1111
1126
|
worker_protocol = info.get("worker_protocol")
|
|
1112
1127
|
if not isinstance(worker_protocol, dict):
|
|
@@ -1272,6 +1287,7 @@ class Worker:
|
|
|
1272
1287
|
self._shutdown_task: asyncio.Task[None] | None = None
|
|
1273
1288
|
self._query_tasks_supported = False
|
|
1274
1289
|
self._workflow_memo_updates_supported = False
|
|
1290
|
+
self._signal_external_workflow_supported = False
|
|
1275
1291
|
self._update_validation_tasks_supported = False
|
|
1276
1292
|
self._query_thread_stop = threading.Event()
|
|
1277
1293
|
self._query_thread: threading.Thread | None = None
|
|
@@ -1505,6 +1521,7 @@ class Worker:
|
|
|
1505
1521
|
raise RuntimeError("query_task_authority_unavailable: require worker protocol 1.20 and "
|
|
1506
1522
|
"Server query_task_authority=true before registration")
|
|
1507
1523
|
self._workflow_memo_updates_supported = _server_supports_workflow_memo_updates(info)
|
|
1524
|
+
self._signal_external_workflow_supported = _server_supports_signal_external_workflow(info)
|
|
1508
1525
|
has_update_validators = any(
|
|
1509
1526
|
contract["update_validators"] for contract in self.workflow_command_contracts.values()
|
|
1510
1527
|
)
|
|
@@ -3002,6 +3019,28 @@ class Worker:
|
|
|
3002
3019
|
log.warning("failed to report workflow memo capability failure: %s", failure_error)
|
|
3003
3020
|
return None
|
|
3004
3021
|
|
|
3022
|
+
if (
|
|
3023
|
+
any(isinstance(command, SignalExternalWorkflow) for command in workflow_commands)
|
|
3024
|
+
and not self._signal_external_workflow_supported
|
|
3025
|
+
):
|
|
3026
|
+
# Refuse before submitting: a Server without the command fails the
|
|
3027
|
+
# task anyway, and the signal must never be sent outside history.
|
|
3028
|
+
message = (
|
|
3029
|
+
"signal_external_workflow_unavailable: the connected runtime did not advertise "
|
|
3030
|
+
"signal_external_workflow support; run this workflow against a Server that does"
|
|
3031
|
+
)
|
|
3032
|
+
try:
|
|
3033
|
+
await self.client.fail_workflow_task(
|
|
3034
|
+
task_id=task_id,
|
|
3035
|
+
lease_owner=self.worker_id,
|
|
3036
|
+
workflow_task_attempt=attempt,
|
|
3037
|
+
message=message,
|
|
3038
|
+
failure_type="RuntimeCapabilityUnsupported",
|
|
3039
|
+
)
|
|
3040
|
+
except Exception as failure_error:
|
|
3041
|
+
log.warning("failed to report signal_external_workflow capability failure: %s", failure_error)
|
|
3042
|
+
return None
|
|
3043
|
+
|
|
3005
3044
|
if not self._cooperative_cancellation_supported and any(
|
|
3006
3045
|
isinstance(command, ScheduleActivity) and command.cancellation_policy is not None
|
|
3007
3046
|
for command in workflow_commands
|