From 473c9032598eedd3b12587f1af31710640a6f5d5 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Thu, 26 Nov 2026 16:29:16 +0000 Subject: [PATCH 1/2] Document service-mode timeout cleanup Native Server 3.30.0 admits timeout_cleanup_seconds on service starts when a supporting worker is on the task queue. Update the timeout-cleanup guide and the saga cross-reference: embedded and service availability, where describe, run detail and the Waterline observation report cleanup (Workflow 2.40.0), the service marker rule and the mixed-queue guidance. Translate the changed paragraphs into every offered locale and record the new source hashes. Refs durable-workflow/workflow#863 Co-Authored-By: Claude Opus 5.5 --- docs/features/sagas.md | 9 +-- docs/features/timeouts.md | 60 ++++++++++++++----- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 14 +++-- i18n/de/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 14 +++-- i18n/es/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 14 +++-- i18n/fr/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 14 +++-- i18n/ja/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 14 +++-- i18n/pt-BR/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 14 +++-- i18n/uk/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 14 +++-- i18n/zh-Hans/source-hashes.json | 4 +- 23 files changed, 142 insertions(+), 67 deletions(-) diff --git a/docs/features/sagas.md b/docs/features/sagas.md index ab7f9a8036c..09ccf19fb69 100644 --- a/docs/features/sagas.md +++ b/docs/features/sagas.md @@ -60,10 +60,11 @@ also provide no cleanup window. The separate [experimental timeout-cleanup option](./timeouts.md#timeout-cleanup) can reserve time for an interruption-driven compensation handler inside the -original hard cap. It is experimental embedded queue support, available in -Workflow 2.29.0 and later with no backward-compatibility promise yet; service -and poll-mode starts refuse it. It does not make compensation automatic or -guarantee an effect when workers are unavailable. +original hard cap. It is experimental, with no backward-compatibility promise +yet. Embedded queue workers support it from Workflow 2.29.0 (embedded poll-mode +starts refuse it), and service mode supports it from native Server 3.30.0 with +supporting SDK workers. It does not make compensation automatic or guarantee an +effect when workers are unavailable. Use an earlier application deadline when timeout should undo completed work. This embedded workflow reserves a resource, then waits up to 30 seconds for a diff --git a/docs/features/timeouts.md b/docs/features/timeouts.md index af964cd1b7c..cb1f745f0a3 100644 --- a/docs/features/timeouts.md +++ b/docs/features/timeouts.md @@ -153,17 +153,18 @@ or run deadline. See [Cancel and Terminate](./cancel-and-terminate.md) and ## Experimental deadline-triggered cleanup {#timeout-cleanup} -**Experimental embedded support.** Available in Workflow 2.29.0 and later for -embedded queue workers only; service and poll-mode starts refuse it. The option +**Experimental.** Embedded queue workers support this option from Workflow +2.29.0; embedded poll-mode starts refuse it. Service mode supports it from +native Server 3.30.0 with supporting workers, as described below. The option is an `experimental` surface under the [stability levels](../compatibility.md#stability-levels), with no backward-compatibility promise yet. Runs that do not opt in keep the default hard-timeout behavior above. -Before enabling this option, install Workflow 2.29.0 or later, run the application -migrations, and deploy compatible embedded queue workers. The new migration -adds `workflow_runs.timeout_cleanup_work_deadline_at`; it does not opt existing -runs in. Do not enable the option before the migration completes. +Before enabling this option in embedded mode, install Workflow 2.29.0 or later, +run the application migrations, and deploy compatible embedded queue workers. +The new migration adds `workflow_runs.timeout_cleanup_work_deadline_at`; it +does not opt existing runs in. Do not enable the option before the migration completes. ```bash php artisan migrate @@ -224,18 +225,49 @@ hard-deadline time. Read the cleanup outcome from history. The `timeout_cleanup` payload on the terminal `WorkflowTimedOut`, `WorkflowTerminated` or `WorkflowCancelled` event, also included in `php artisan workflow:v2:history-export` output, is the -authoritative record. Control-plane describe output and the run summary carry -no cleanup outcome, and run detail shows at most a note such as "Timeout -cleanup failed." (nothing for `preempted`). +authoritative record. From Workflow 2.40.0, and on native Server 3.30.0 and +later, describe reports the recorded state under `run.timeout_cleanup`, and run +detail and the bounded run observation that Waterline reads report it as +top-level `timeout_cleanup`. While cleanup is open, it shows `outcome: running` +with `cause: timeout`, the timeout kind, the detection time and the work and +cleanup deadlines. After closure, it shows the terminal outcome, with +`failure_id` for `failed`. The field is omitted when no cleanup was recorded. Unavailable or delayed workers cannot guarantee an external cleanup effect; keep compensation idempotent and reconcile uncertain effects in your application. -This increment supports embedded queue workers only. Poll-mode and service -starts refuse the option, and bridge workers cannot claim an opted-in embedded -run. Native admission and SDK runtime delivery remain pending under -[Server #1201](https://github.com/durable-workflow/server/issues/1201); parser -support alone does not implement timeout cleanup. +In embedded mode, bridge workers cannot claim an opted-in run; the claim +returns `timeout_cleanup_not_supported` without taking the lease. + +**Service mode.** Native Server 3.30.0 and later accepts +`timeout_cleanup_seconds` on service starts and `start_child_workflow` +commands, with the same limits as the embedded allowance, and advertises `timeout_cleanup: {supported: true, version: 1}`. +It admits an opted-in start only when a live worker on the task queue +advertises the capability. Otherwise it answers +`422 timeout_cleanup_not_supported`, writes nothing and never falls back to a +plain hard timeout. Workers with cooperative cancellation enabled advertise +the capability from PHP SDK 3.31.0 (3.32.0 for the stricter marker rule +below), Python SDK 2.24.0 and Rust SDK 4.25.0. Workflow code receives the +SDK's cooperative-cancellation interruption with `cause: timeout`. See +[Cooperative Cancellation](../polyglot/cancellation.md). + +For SDK authors: a service worker reports an uncaught or rethrown cleanup +interruption with `fail_workflow.failure.interruption: "timeout_cleanup"`, and +only for the interruption it delivered for the run's root timeout request (no +parent request, no scope). Anything else, including an application-built or +wrapped interruption, records `failed`. Server accepts the marker only while +the run's engine-owned timeout request is active and only from a claim that +negotiated `timeout_cleanup`. Workflow 2.42.0 states this rule in the +[portable contract](https://github.com/durable-workflow/workflow/blob/main/docs/architecture/timeout-cleanup.md). + +**Mixed queues.** Admission checks only that at least one live worker on the +task queue advertises `timeout_cleanup`; any worker on the queue can claim the +cleanup turn. Server refuses the marker from a worker that did not advertise +the capability, so an interruption that escapes there is recorded as `failed` +or `expired`. But such a worker may never deliver the interruption: if its +workflow code returns, the run records cleanup `completed` although no cleanup +ran. Before starting opted-in runs on a queue, upgrade every worker on it to a +supporting SDK with cooperative cancellation enabled. ## Workflow-task lease {#workflow-task-lease} diff --git a/i18n/de/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/de/docusaurus-plugin-content-docs/current/features/sagas.md index b06fccfe14b..38721fe1e95 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/features/sagas.md @@ -53,7 +53,7 @@ Aktivitäten laufen mindestens einmal. Ein vorwärts gerichteter Aufruf kann dah Bei der standardmäßigen harten Timeout-Regel gilt: Ein von der Engine durchgesetztes [Workflow-Zeitlimit](./timeouts.md#timeout-outcome-and-cleanup) schließt den Lauf, bevor Workflow-Code Kompensation ausführen kann. Ein `catch`- oder `finally`-Block ändert dies nicht. Auch die unmittelbaren Befehle `cancel()` und `terminate()` bieten kein Aufräumfenster. -Die separate [experimentelle Timeout-Cleanup-Option](./timeouts.md#timeout-cleanup) kann innerhalb der ursprünglichen harten Grenze Zeit für einen durch Unterbrechung ausgelösten Kompensationshandler reservieren. Sie ist experimentelle Unterstützung für Embedded-Queue-Worker, verfügbar ab Workflow 2.29.0 und noch ohne Zusage zur Abwärtskompatibilität; Service- und Poll-Starts lehnen sie ab. Sie macht Kompensation nicht automatisch und garantiert bei fehlenden Workern keine Wirkung. +Die separate [experimentelle Timeout-Cleanup-Option](./timeouts.md#timeout-cleanup) kann innerhalb der ursprünglichen harten Grenze Zeit für einen durch Unterbrechung ausgelösten Kompensationshandler reservieren. Sie ist experimentell und hat noch keine Zusage zur Abwärtskompatibilität. Embedded-Queue-Worker unterstützen sie ab Workflow 2.29.0 (Embedded-Poll-Starts lehnen sie ab), der Service-Modus ab nativem Server 3.30.0 mit unterstützenden SDK-Workern. Sie macht Kompensation nicht automatisch und garantiert bei fehlenden Workern keine Wirkung. Verwenden Sie eine frühere Anwendungsfrist, wenn bei Ablauf bereits erledigte Arbeit zurückgenommen werden soll. Dieser eingebettete Workflow reserviert eine Ressource und wartet danach höchstens 30 Sekunden auf ein Bestätigungssignal. Bei Ablauf wird Workflow-Code fortgesetzt, der die Reservierung vor Rückgabe des fachlichen Ergebnisses `expired` freigibt: diff --git a/i18n/de/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/de/docusaurus-plugin-content-docs/current/features/timeouts.md index ec479d70153..bccf1aa43e8 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -137,9 +137,9 @@ Auch die unmittelbaren Befehle `cancel()` und `terminate()` schließen den Lauf ## Experimentelles deadlinegesteuertes Cleanup {#timeout-cleanup} -**Experimentelle Embedded-Unterstützung.** Verfügbar ab Workflow 2.29.0, nur für Embedded-Queue-Worker; Service- und Poll-Starts lehnen die Option ab. Die Option ist eine `experimental`-Oberfläche gemäß den [Stabilitätsstufen](../compatibility.md#stability-levels) und hat noch keine Zusage zur Abwärtskompatibilität. Runs ohne Anmeldung behalten das oben beschriebene harte Timeout als Standard. +**Experimentell.** Embedded-Queue-Worker unterstützen diese Option ab Workflow 2.29.0; Embedded-Poll-Starts lehnen sie ab. Der Service-Modus unterstützt sie ab nativem Server 3.30.0 mit unterstützenden Workern, wie unten beschrieben. Die Option ist eine `experimental`-Oberfläche gemäß den [Stabilitätsstufen](../compatibility.md#stability-levels) und hat noch keine Zusage zur Abwärtskompatibilität. Runs ohne Anmeldung behalten das oben beschriebene harte Timeout als Standard. -Installieren Sie vor Aktivierung Workflow 2.29.0 oder neuer, führen Sie die Anwendungsmigrationen aus und stellen Sie kompatible Embedded-Queue-Worker bereit. Die neue Migration ergänzt `workflow_runs.timeout_cleanup_work_deadline_at`; vorhandene Runs werden dadurch nicht angemeldet. Aktivieren Sie die Option erst nach abgeschlossener Migration. +Installieren Sie vor Aktivierung im Embedded-Modus Workflow 2.29.0 oder neuer, führen Sie die Anwendungsmigrationen aus und stellen Sie kompatible Embedded-Queue-Worker bereit. Die neue Migration ergänzt `workflow_runs.timeout_cleanup_work_deadline_at`; vorhandene Runs werden dadurch nicht angemeldet. Aktivieren Sie die Option erst nach abgeschlossener Migration. ```bash php artisan migrate @@ -176,11 +176,17 @@ Cleanup hat ein separates `timeout_cleanup.outcome`: Abgeschlossenes, fehlgeschlagenes oder abgelaufenes Cleanup endet weiterhin mit Geschäftsstatus `failed`, `closed_reason = timed_out` und `WorkflowTimedOut`. Erfolgreiche Kompensation macht daraus keinen erfolgreichen Workflow. Wird Cleanup früh abgeschlossen, schließt der Run sofort, die Timeout-Meldung nennt aber weiterhin den Zeitpunkt der ursprünglichen harten Deadline. -Lesen Sie das Cleanup-Ergebnis aus dem Verlauf. Die `timeout_cleanup`-Payload am terminalen Ereignis `WorkflowTimedOut`, `WorkflowTerminated` oder `WorkflowCancelled`, die auch in der Ausgabe von `php artisan workflow:v2:history-export` enthalten ist, ist der maßgebliche Nachweis. Describe-Ausgabe der Control Plane und Run-Zusammenfassung enthalten kein Cleanup-Ergebnis; Run-Details zeigen höchstens einen Hinweis wie „Timeout cleanup failed.“ (bei `preempted` nichts). +Lesen Sie das Cleanup-Ergebnis aus dem Verlauf. Die `timeout_cleanup`-Payload am terminalen Ereignis `WorkflowTimedOut`, `WorkflowTerminated` oder `WorkflowCancelled`, die auch in der Ausgabe von `php artisan workflow:v2:history-export` enthalten ist, ist der maßgebliche Nachweis. Ab Workflow 2.40.0 und auf nativem Server 3.30.0 oder neuer meldet Describe den aufgezeichneten Zustand unter `run.timeout_cleanup`; Run-Details und die begrenzte Run-Beobachtung, die Waterline liest, melden ihn als `timeout_cleanup` auf oberster Ebene. Solange Cleanup läuft, zeigt das Feld `outcome: running` mit `cause: timeout`, der Timeout-Art, dem Erkennungszeitpunkt sowie der Arbeits- und der Cleanup-Deadline. Nach dem Abschluss zeigt es das terminale Ergebnis, bei `failed` mit `failure_id`. Wurde kein Cleanup aufgezeichnet, fehlt das Feld. Fehlende oder verzögerte Worker können keine externe Cleanup-Wirkung garantieren; halten Sie Kompensation idempotent und gleichen Sie unsichere Wirkungen in der Anwendung ab. -Dieser Schritt unterstützt nur Embedded-Queue-Worker. Poll- und Service-Starts lehnen die Option ab; Bridge-Worker können einen angemeldeten Embedded-Run nicht claimen. Native Admission und SDK-Laufzeitzustellung bleiben unter [Server #1201](https://github.com/durable-workflow/server/issues/1201) offen; Parser-Unterstützung allein implementiert kein Timeout-Cleanup. +Im Embedded-Modus können Bridge-Worker einen angemeldeten Run nicht claimen; der Claim liefert `timeout_cleanup_not_supported`, ohne die Lease zu übernehmen. + +**Service-Modus.** Nativer Server 3.30.0 und neuer akzeptiert `timeout_cleanup_seconds` bei Service-Starts und `start_child_workflow`-Befehlen mit denselben Grenzen wie das Embedded-Budget und kündigt `timeout_cleanup: {supported: true, version: 1}` an. Er nimmt einen angemeldeten Start nur an, wenn ein aktiver Worker auf der Task-Queue die Fähigkeit ankündigt. Andernfalls antwortet er mit `422 timeout_cleanup_not_supported`, schreibt nichts und fällt nie auf ein einfaches hartes Timeout zurück. Worker mit aktiviertem kooperativem Abbruch kündigen die Fähigkeit ab PHP SDK 3.31.0 (3.32.0 für die strengere Marker-Regel unten), Python SDK 2.24.0 und Rust SDK 4.25.0 an. Workflow-Code erhält die Unterbrechung des kooperativen Abbruchs seines SDK mit `cause: timeout`. Siehe [Kooperativer Abbruch](../polyglot/cancellation.md). + +Für SDK-Autoren: Ein Service-Worker meldet eine nicht abgefangene oder erneut geworfene Cleanup-Unterbrechung mit `fail_workflow.failure.interruption: "timeout_cleanup"`, und zwar nur für die Unterbrechung, die er für die Root-Timeout-Anfrage des Runs zugestellt hat (keine Eltern-Anfrage, kein Scope). Alles andere, auch eine von der Anwendung erzeugte oder eingehüllte Unterbrechung, zeichnet `failed` auf. Der Server akzeptiert den Marker nur, solange die Engine-eigene Timeout-Anfrage des Runs aktiv ist, und nur von einem Claim, der `timeout_cleanup` ausgehandelt hat. Workflow 2.42.0 beschreibt diese Regel im [portablen Vertrag](https://github.com/durable-workflow/workflow/blob/main/docs/architecture/timeout-cleanup.md). + +**Gemischte Queues.** Die Annahme prüft nur, ob mindestens ein aktiver Worker auf der Task-Queue `timeout_cleanup` ankündigt; jeder Worker der Queue kann den Cleanup-Turn claimen. Der Server lehnt den Marker von einem Worker ab, der die Fähigkeit nicht angekündigt hat, sodass eine dort entkommene Unterbrechung als `failed` oder `expired` aufgezeichnet wird. Ein solcher Worker stellt die Unterbrechung aber möglicherweise nie zu: Kehrt sein Workflow-Code zurück, zeichnet der Run Cleanup als `completed` auf, obwohl kein Cleanup lief. Aktualisieren Sie vor dem Start angemeldeter Runs auf einer Queue jeden Worker dieser Queue auf ein unterstützendes SDK mit aktiviertem kooperativem Abbruch. ## Lease eines Workflow-Tasks {#workflow-task-lease} diff --git a/i18n/de/source-hashes.json b/i18n/de/source-hashes.json index d830f72396f..0227204f075 100644 --- a/i18n/de/source-hashes.json +++ b/i18n/de/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "522cd4a24a2c6f04c774d397b481ed4aa4faf356d97bff6ea0c36656db114df0", + "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "c0d2d4108b195d10a759a4cc5368e0d13a48bde4a46005601ec15d58198f409a", + "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/es/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/es/docusaurus-plugin-content-docs/current/features/sagas.md index 9cd4d643886..8fb8e244e5b 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/features/sagas.md @@ -53,7 +53,7 @@ Las actividades se ejecutan al menos una vez, así que una llamada de avance pue Con la política predeterminada de timeout estricto: Un [tiempo de espera de workflow](./timeouts.md#timeout-outcome-and-cleanup) aplicado por el motor cierra la ejecución antes de que su código pueda compensar. Un bloque `catch` o `finally` no cambia ese comportamiento. Las órdenes inmediatas `cancel()` y `terminate()` tampoco dan tiempo para la limpieza. -La [opción experimental de limpieza por timeout](./timeouts.md#timeout-cleanup) puede reservar tiempo dentro del límite estricto original para un manejador de compensación activado por una interrupción. Es soporte experimental para workers de cola embebidos, disponible en Workflow 2.29.0 y posteriores y aún sin promesa de compatibilidad hacia atrás; los inicios de servicio y en modo poll lo rechazan. No hace automática la compensación ni garantiza efectos sin workers disponibles. +La [opción experimental de limpieza por timeout](./timeouts.md#timeout-cleanup) puede reservar tiempo dentro del límite estricto original para un manejador de compensación activado por una interrupción. Es experimental y aún no tiene promesa de compatibilidad hacia atrás. Los workers de cola embebidos la admiten desde Workflow 2.29.0 (los inicios embebidos en modo poll la rechazan), y el modo servicio la admite desde Server nativo 3.30.0 con workers de SDK compatibles. No hace automática la compensación ni garantiza efectos sin workers disponibles. Use un plazo anterior de la aplicación cuando quiera revertir el trabajo completado al agotarse el tiempo. Este workflow integrado reserva un recurso y espera hasta 30 segundos una señal de confirmación. Al vencer, el código del workflow se reanuda, libera la reserva y devuelve el resultado de negocio `expired`: diff --git a/i18n/es/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/es/docusaurus-plugin-content-docs/current/features/timeouts.md index ebbb58074ba..99b3bb3d62d 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -137,9 +137,9 @@ Las órdenes inmediatas `cancel()` y `terminate()` también cierran la ejecució ## Limpieza experimental activada por el plazo {#timeout-cleanup} -**Soporte embebido experimental.** Disponible en Workflow 2.29.0 y posteriores solo para workers de cola embebidos; los inicios de servicio y en modo poll rechazan la opción. La opción es una superficie `experimental` según los [niveles de estabilidad](../compatibility.md#stability-levels) y aún no tiene promesa de compatibilidad hacia atrás. Las ejecuciones que no la activan conservan el timeout estricto predeterminado descrito arriba. +**Experimental.** Los workers de cola embebidos admiten esta opción desde Workflow 2.29.0; los inicios embebidos en modo poll la rechazan. El modo servicio la admite desde Server nativo 3.30.0 con workers compatibles, como se describe más abajo. La opción es una superficie `experimental` según los [niveles de estabilidad](../compatibility.md#stability-levels) y aún no tiene promesa de compatibilidad hacia atrás. Las ejecuciones que no la activan conservan el timeout estricto predeterminado descrito arriba. -Antes de activar la opción, instale Workflow 2.29.0 o posterior, ejecute las migraciones de la aplicación y despliegue workers de cola embebidos compatibles. La nueva migración añade `workflow_runs.timeout_cleanup_work_deadline_at`; no activa la opción para ejecuciones existentes. No la active antes de completar la migración. +Antes de activar la opción en modo embebido, instale Workflow 2.29.0 o posterior, ejecute las migraciones de la aplicación y despliegue workers de cola embebidos compatibles. La nueva migración añade `workflow_runs.timeout_cleanup_work_deadline_at`; no activa la opción para ejecuciones existentes. No la active antes de completar la migración. ```bash php artisan migrate @@ -176,11 +176,17 @@ La limpieza tiene un `timeout_cleanup.outcome` independiente: La limpieza completada, fallida o expirada mantiene el estado de negocio `failed`, `closed_reason = timed_out` y `WorkflowTimedOut`. Compensar correctamente no convierte el timeout en éxito. Si la limpieza termina antes, la ejecución se cierra de inmediato, pero el mensaje de timeout sigue citando la hora del plazo estricto original. -Lea el resultado de la limpieza en el historial. El payload `timeout_cleanup` del evento terminal `WorkflowTimedOut`, `WorkflowTerminated` o `WorkflowCancelled`, incluido también en la salida de `php artisan workflow:v2:history-export`, es el registro autorizado. La salida de describe del plano de control y el resumen del run no incluyen el resultado de la limpieza, y el detalle del run muestra como mucho una nota como «Timeout cleanup failed.» (nada para `preempted`). +Lea el resultado de la limpieza en el historial. El payload `timeout_cleanup` del evento terminal `WorkflowTimedOut`, `WorkflowTerminated` o `WorkflowCancelled`, incluido también en la salida de `php artisan workflow:v2:history-export`, es el registro autorizado. Desde Workflow 2.40.0, y en Server nativo 3.30.0 y posteriores, describe informa el estado registrado en `run.timeout_cleanup`, y el detalle del run y la observación acotada del run que lee Waterline lo informan como `timeout_cleanup` de nivel superior. Mientras la limpieza está abierta, muestra `outcome: running` con `cause: timeout`, el tipo de timeout, la hora de detección y los plazos de trabajo y de limpieza. Tras el cierre, muestra el resultado terminal, con `failure_id` para `failed`. El campo se omite cuando no se registró ninguna limpieza. Los workers ausentes o demorados no garantizan un efecto externo de limpieza; use compensaciones idempotentes y reconcilie los efectos inciertos en su aplicación. -Este incremento solo admite workers de cola embebidos. Los inicios en modo poll y servicio rechazan la opción; los workers bridge no pueden reclamar una ejecución embebida con la opción. La admisión nativa y la entrega de runtime en los SDK siguen pendientes en [Server #1201](https://github.com/durable-workflow/server/issues/1201); el soporte de parser por sí solo no implementa la limpieza por timeout. +En modo embebido, los workers bridge no pueden reclamar una ejecución con la opción activada; la reclamación devuelve `timeout_cleanup_not_supported` sin tomar el lease. + +**Modo servicio.** Server nativo 3.30.0 y posteriores acepta `timeout_cleanup_seconds` en inicios de servicio y en comandos `start_child_workflow`, con los mismos límites que la asignación embebida, y anuncia `timeout_cleanup: {supported: true, version: 1}`. Solo admite un inicio con la opción cuando un worker activo de la cola de tareas anuncia la capacidad. En caso contrario responde `422 timeout_cleanup_not_supported`, no escribe nada y nunca recurre a un timeout estricto simple. Los workers con la cancelación cooperativa habilitada anuncian la capacidad desde PHP SDK 3.31.0 (3.32.0 para la regla de marcador más estricta descrita abajo), Python SDK 2.24.0 y Rust SDK 4.25.0. El código del workflow recibe la interrupción de cancelación cooperativa del SDK con `cause: timeout`. Consulte [Cancelación cooperativa](../polyglot/cancellation.md). + +Para autores de SDK: un worker de servicio informa una interrupción de limpieza no capturada o relanzada con `fail_workflow.failure.interruption: "timeout_cleanup"`, y solo para la interrupción que entregó para la solicitud de timeout raíz del run (sin solicitud padre ni scope). Cualquier otra cosa, incluida una interrupción construida por la aplicación o envuelta, registra `failed`. Server acepta el marcador solo mientras la solicitud de timeout propiedad del motor está activa y solo desde una reclamación que negoció `timeout_cleanup`. Workflow 2.42.0 enuncia esta regla en el [contrato portable](https://github.com/durable-workflow/workflow/blob/main/docs/architecture/timeout-cleanup.md). + +**Colas mixtas.** La admisión solo comprueba que al menos un worker activo de la cola de tareas anuncie `timeout_cleanup`; cualquier worker de la cola puede reclamar el turno de limpieza. Server rechaza el marcador de un worker que no anunció la capacidad, por lo que una interrupción que escapa allí se registra como `failed` o `expired`. Pero ese worker puede no entregar nunca la interrupción: si el código de su workflow retorna, el run registra la limpieza como `completed` aunque no se ejecutó ninguna limpieza. Antes de iniciar ejecuciones con la opción en una cola, actualice todos sus workers a un SDK compatible con la cancelación cooperativa habilitada. ## Lease de una tarea de workflow {#workflow-task-lease} diff --git a/i18n/es/source-hashes.json b/i18n/es/source-hashes.json index d830f72396f..0227204f075 100644 --- a/i18n/es/source-hashes.json +++ b/i18n/es/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "522cd4a24a2c6f04c774d397b481ed4aa4faf356d97bff6ea0c36656db114df0", + "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "c0d2d4108b195d10a759a4cc5368e0d13a48bde4a46005601ec15d58198f409a", + "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/fr/docusaurus-plugin-content-docs/current/features/sagas.md index f3977e3ec7f..3d5279eb205 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/features/sagas.md @@ -53,7 +53,7 @@ Les activités s’exécutent au moins une fois : un appel d’avancement peut d Avec la politique par défaut d’expiration stricte : Une [expiration du workflow imposée par le moteur](./timeouts.md#timeout-outcome-and-cleanup) ferme le run avant que le code puisse exécuter la compensation. Un bloc `catch` ou `finally` ne change pas ce comportement. Les commandes immédiates `cancel()` et `terminate()` n’offrent pas non plus de fenêtre de nettoyage. -L’[option expérimentale de nettoyage après timeout](./timeouts.md#timeout-cleanup) peut réserver du temps dans le plafond strict original pour un gestionnaire de compensation déclenché par interruption. C’est une prise en charge expérimentale des workers de file intégrés, disponible à partir de Workflow 2.29.0 et sans promesse de rétrocompatibilité pour l’instant ; les démarrages en mode service et poll la refusent. Elle ne rend pas la compensation automatique et ne garantit pas d’effet sans worker disponible. +L’[option expérimentale de nettoyage après timeout](./timeouts.md#timeout-cleanup) peut réserver du temps dans le plafond strict original pour un gestionnaire de compensation déclenché par interruption. Elle est expérimentale, sans promesse de rétrocompatibilité pour l’instant. Les workers de file intégrés la prennent en charge à partir de Workflow 2.29.0 (les démarrages intégrés en mode poll la refusent), et le mode service à partir de Server natif 3.30.0 avec des workers SDK compatibles. Elle ne rend pas la compensation automatique et ne garantit pas d’effet sans worker disponible. Utilisez une échéance applicative plus courte si l’expiration doit annuler du travail déjà effectué. Ce workflow intégré réserve une ressource, puis attend un signal de confirmation pendant au plus 30 secondes. L’expiration reprend le code, qui libère la réservation avant de renvoyer le résultat métier `expired` : diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/fr/docusaurus-plugin-content-docs/current/features/timeouts.md index 57ef9cf172f..04c7471f44e 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -137,9 +137,9 @@ Les commandes immédiates `cancel()` et `terminate()` ferment aussi le run sans ## Nettoyage expérimental déclenché par une échéance {#timeout-cleanup} -**Prise en charge intégrée expérimentale.** Disponible à partir de Workflow 2.29.0, uniquement pour les workers de file intégrés ; les démarrages en mode service et poll refusent l’option. L’option est une surface `experimental` selon les [niveaux de stabilité](../compatibility.md#stability-levels), sans promesse de rétrocompatibilité pour l’instant. Les runs qui ne l’activent pas conservent le timeout strict par défaut décrit ci-dessus. +**Expérimental.** Les workers de file intégrés prennent en charge cette option à partir de Workflow 2.29.0 ; les démarrages intégrés en mode poll la refusent. Le mode service la prend en charge à partir de Server natif 3.30.0 avec des workers compatibles, comme décrit ci-dessous. L’option est une surface `experimental` selon les [niveaux de stabilité](../compatibility.md#stability-levels), sans promesse de rétrocompatibilité pour l’instant. Les runs qui ne l’activent pas conservent le timeout strict par défaut décrit ci-dessus. -Avant d’activer l’option, installez Workflow 2.29.0 ou une version ultérieure, exécutez les migrations de l’application et déployez des workers de file intégrés compatibles. La nouvelle migration ajoute `workflow_runs.timeout_cleanup_work_deadline_at` ; elle n’active pas l’option sur les runs existants. Attendez la fin de la migration avant activation. +Avant d’activer l’option en mode intégré, installez Workflow 2.29.0 ou une version ultérieure, exécutez les migrations de l’application et déployez des workers de file intégrés compatibles. La nouvelle migration ajoute `workflow_runs.timeout_cleanup_work_deadline_at` ; elle n’active pas l’option sur les runs existants. Attendez la fin de la migration avant activation. ```bash php artisan migrate @@ -176,11 +176,17 @@ Le nettoyage a un `timeout_cleanup.outcome` distinct : Un nettoyage terminé, échoué ou expiré laisse le statut métier `failed`, `closed_reason = timed_out` et `WorkflowTimedOut`. Une compensation réussie ne transforme pas le timeout en succès du workflow. Si le nettoyage se termine plus tôt, le run se ferme aussitôt, mais le message de timeout cite toujours l’heure de l’échéance stricte d’origine. -Lisez le résultat du nettoyage dans l’historique. Le payload `timeout_cleanup` de l’événement terminal `WorkflowTimedOut`, `WorkflowTerminated` ou `WorkflowCancelled`, également présent dans la sortie de `php artisan workflow:v2:history-export`, fait foi. La sortie describe du plan de contrôle et le résumé du run ne contiennent pas le résultat du nettoyage, et le détail du run affiche au plus une note comme « Timeout cleanup failed. » (rien pour `preempted`). +Lisez le résultat du nettoyage dans l’historique. Le payload `timeout_cleanup` de l’événement terminal `WorkflowTimedOut`, `WorkflowTerminated` ou `WorkflowCancelled`, également présent dans la sortie de `php artisan workflow:v2:history-export`, fait foi. À partir de Workflow 2.40.0, et sur Server natif 3.30.0 ou ultérieur, describe expose l’état enregistré sous `run.timeout_cleanup`, et le détail du run ainsi que l’observation bornée du run lue par Waterline l’exposent comme `timeout_cleanup` de premier niveau. Pendant le nettoyage, il indique `outcome: running` avec `cause: timeout`, le type de timeout, l’heure de détection et les échéances de travail et de nettoyage. Après la clôture, il indique le résultat terminal, avec `failure_id` pour `failed`. Le champ est omis si aucun nettoyage n’a été enregistré. Des workers absents ou retardés ne garantissent pas l’effet externe du nettoyage ; gardez les compensations idempotentes et réconciliez les effets incertains dans l’application. -Cet incrément ne prend en charge que les workers de file intégrés. Les démarrages poll et service refusent l’option ; les workers bridge ne peuvent pas acquérir un run intégré ayant opté pour elle. L’admission native et la livraison d’exécution par les SDK restent suivies dans [Server #1201](https://github.com/durable-workflow/server/issues/1201) ; le support du parser seul n’implémente pas le nettoyage après timeout. +En mode intégré, les workers bridge ne peuvent pas acquérir un run ayant opté pour l’option ; l’acquisition renvoie `timeout_cleanup_not_supported` sans prendre le bail. + +**Mode service.** Server natif 3.30.0 et versions ultérieures accepte `timeout_cleanup_seconds` sur les démarrages en mode service et les commandes `start_child_workflow`, avec les mêmes limites que l’allocation intégrée, et annonce `timeout_cleanup: {supported: true, version: 1}`. Il n’admet un démarrage ayant opté que si un worker actif de la file de tâches annonce la capacité. Sinon, il répond `422 timeout_cleanup_not_supported`, n’écrit rien et ne se replie jamais sur un simple timeout strict. Les workers dont l’annulation coopérative est activée annoncent la capacité à partir de PHP SDK 3.31.0 (3.32.0 pour la règle de marqueur plus stricte ci-dessous), Python SDK 2.24.0 et Rust SDK 4.25.0. Le code du workflow reçoit l’interruption d’annulation coopérative du SDK avec `cause: timeout`. Voir [Annulation coopérative](../polyglot/cancellation.md). + +Pour les auteurs de SDK : un worker en mode service signale une interruption de nettoyage non interceptée ou relancée avec `fail_workflow.failure.interruption: "timeout_cleanup"`, et uniquement pour l’interruption qu’il a livrée pour la requête de timeout racine du run (sans requête parente ni scope). Tout le reste, y compris une interruption construite par l’application ou enveloppée, enregistre `failed`. Server n’accepte le marqueur que tant que la requête de timeout propre au moteur est active, et seulement depuis une acquisition qui a négocié `timeout_cleanup`. Workflow 2.42.0 énonce cette règle dans le [contrat portable](https://github.com/durable-workflow/workflow/blob/main/docs/architecture/timeout-cleanup.md). + +**Files mixtes.** L’admission vérifie seulement qu’au moins un worker actif de la file de tâches annonce `timeout_cleanup` ; n’importe quel worker de la file peut acquérir le tour de nettoyage. Server refuse le marqueur d’un worker qui n’a pas annoncé la capacité, de sorte qu’une interruption qui s’y échappe est enregistrée comme `failed` ou `expired`. Mais un tel worker peut ne jamais livrer l’interruption : si son code de workflow retourne, le run enregistre le nettoyage comme `completed` alors qu’aucun nettoyage n’a eu lieu. Avant de démarrer des runs ayant opté sur une file, mettez à niveau tous ses workers vers un SDK compatible avec l’annulation coopérative activée. ## Bail d’une tâche de workflow {#workflow-task-lease} diff --git a/i18n/fr/source-hashes.json b/i18n/fr/source-hashes.json index d830f72396f..0227204f075 100644 --- a/i18n/fr/source-hashes.json +++ b/i18n/fr/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "522cd4a24a2c6f04c774d397b481ed4aa4faf356d97bff6ea0c36656db114df0", + "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "c0d2d4108b195d10a759a4cc5368e0d13a48bde4a46005601ec15d58198f409a", + "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/ja/docusaurus-plugin-content-docs/current/features/sagas.md index 6ca27db8bed..4a25263c2a4 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/features/sagas.md @@ -51,7 +51,7 @@ class BookingSagaWorkflow extends Workflow 既定のハードタイムアウトの方針では、エンジンの[ワークフロータイムアウト](./timeouts.md#timeout-outcome-and-cleanup)は、ワークフローコードが補償を実行する前に実行を閉じます。`catch` や `finally` はこの動作を変えません。即時の `cancel()` と `terminate()` にもクリーンアップ猶予はありません。 -別の[実験的なタイムアウトクリーンアップオプション](./timeouts.md#timeout-cleanup)は、元のハード上限内に、割り込みで起動する補償ハンドラーの時間を予約できます。Workflow 2.29.0 以降で使える embedded queue worker 向けの実験的サポートで、後方互換性はまだ約束されていません。service と poll mode の開始はこのオプションを拒否します。補償を自動化したり、worker 不在時の効果を保証したりするものではありません。 +別の[実験的なタイムアウトクリーンアップオプション](./timeouts.md#timeout-cleanup)は、元のハード上限内に、割り込みで起動する補償ハンドラーの時間を予約できます。これは実験的な機能で、後方互換性はまだ約束されていません。embedded queue worker は Workflow 2.29.0 以降でサポートし(embedded の poll mode の開始は拒否します)、service mode は native Server 3.30.0 以降で対応 SDK の worker と組み合わせてサポートします。補償を自動化したり、worker 不在時の効果を保証したりするものではありません。 タイムアウト時に完了済み作業を取り消したい場合は、アプリケーション側に早い期限を設けます。この組み込みワークフローはリソースを予約し、確認シグナルを最大 30 秒待ちます。待機が期限切れになるとコードが再開し、予約を解放してから業務結果 `expired` を返します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/ja/docusaurus-plugin-content-docs/current/features/timeouts.md index d6d21d64c70..766bd79b732 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -135,9 +135,9 @@ $description['run']['run_deadline_at']; // ISO 8601 timestamp ## 期限による実験的なタイムアウトクリーンアップ {#timeout-cleanup} -**実験的な embedded サポート。** Workflow 2.29.0 以降で embedded queue worker のみに提供され、service と poll mode の開始はオプションを拒否します。このオプションは[安定性レベル](../compatibility.md#stability-levels)の `experimental` サーフェスで、後方互換性はまだ約束されていません。オプションを有効にしない run は上記の既定のハードタイムアウトを維持します。 +**実験的。** embedded queue worker は Workflow 2.29.0 以降でこのオプションをサポートし、embedded の poll mode の開始はこれを拒否します。service mode では、下記のとおり native Server 3.30.0 以降で対応 worker と組み合わせてサポートされます。このオプションは[安定性レベル](../compatibility.md#stability-levels)の `experimental` サーフェスで、後方互換性はまだ約束されていません。オプションを有効にしない run は上記の既定のハードタイムアウトを維持します。 -有効化する前に、Workflow 2.29.0 以降をインストールし、アプリケーションの migration を実行し、互換性のある embedded queue worker を配置してください。新しい migration は `workflow_runs.timeout_cleanup_work_deadline_at` を追加しますが、既存の run でオプションを有効にはしません。migration の完了前に有効化しないでください。 +embedded mode で有効化する前に、Workflow 2.29.0 以降をインストールし、アプリケーションの migration を実行し、互換性のある embedded queue worker を配置してください。新しい migration は `workflow_runs.timeout_cleanup_work_deadline_at` を追加しますが、既存の run でオプションを有効にはしません。migration の完了前に有効化しないでください。 ```bash php artisan migrate @@ -174,11 +174,17 @@ worker が作業期限を検出すると、run は一度だけクリーンアッ クリーンアップの完了、失敗、期限切れのいずれでも、業務状態は `failed`、`closed_reason = timed_out`、`WorkflowTimedOut` です。補償が成功しても、タイムアウトが workflow の成功には変わりません。クリーンアップが早く完了すると run はすぐに閉じますが、タイムアウトのメッセージには元のハード期限の時刻が記載されます。 -クリーンアップ結果は履歴で確認してください。終端イベント `WorkflowTimedOut`、`WorkflowTerminated`、`WorkflowCancelled` の `timeout_cleanup` ペイロードが正式な記録で、`php artisan workflow:v2:history-export` の出力にも含まれます。control plane の describe 出力と run summary にはクリーンアップ結果がなく、run detail には「Timeout cleanup failed.」のような注記が出る程度です(`preempted` では何も出ません)。 +クリーンアップ結果は履歴で確認してください。終端イベント `WorkflowTimedOut`、`WorkflowTerminated`、`WorkflowCancelled` の `timeout_cleanup` ペイロードが正式な記録で、`php artisan workflow:v2:history-export` の出力にも含まれます。Workflow 2.40.0 以降と native Server 3.30.0 以降では、describe は記録されたクリーンアップ状態を `run.timeout_cleanup` で返し、run detail と Waterline が読む bounded run observation はトップレベルの `timeout_cleanup` で返します。クリーンアップ中は `outcome: running` と `cause: timeout`、タイムアウトの種類、検出時刻、作業期限、クリーンアップ期限を示します。終了後は終端の結果を示し、`failed` の場合は `failure_id` も含みます。クリーンアップが記録されていない場合、このフィールドは省略されます。 不在または遅延した worker は外部クリーンアップの効果を保証できません。補償を冪等にし、効果が不明な場合はアプリケーションで照合してください。 -この実装は embedded queue worker のみを対象とします。poll mode と service の開始はオプションを拒否し、bridge worker は有効化された embedded run を claim できません。native admission と SDK の runtime delivery は [Server #1201](https://github.com/durable-workflow/server/issues/1201)で対応待ちです。parser の対応だけではタイムアウトクリーンアップは実装されません。 +embedded mode では、bridge worker は有効化された run を claim できません。claim はリースを取得せずに `timeout_cleanup_not_supported` を返します。 + +**service mode。** native Server 3.30.0 以降は、service の開始と `start_child_workflow` コマンドで `timeout_cleanup_seconds` を embedded の割り当てと同じ制限で受け付け、`timeout_cleanup: {supported: true, version: 1}` を広告します。有効化された開始は、タスクキュー上の live worker がこの capability を広告している場合にのみ受け付けます。それ以外の場合は `422 timeout_cleanup_not_supported` を返して何も書き込まず、通常のハードタイムアウトにフォールバックすることもありません。協調的キャンセルを有効にした worker は、PHP SDK 3.31.0(下記のより厳密なマーカー規則は 3.32.0)、Python SDK 2.24.0、Rust SDK 4.25.0 以降でこの capability を広告します。workflow コードは SDK の協調的キャンセル割り込みを `cause: timeout` 付きで受け取ります。[協調的キャンセル](../polyglot/cancellation.md)を参照してください。 + +SDK 作成者向け: service worker は、捕捉されなかった、または再送出されたクリーンアップ割り込みを `fail_workflow.failure.interruption: "timeout_cleanup"` で報告します。対象は、run のルートのタイムアウト要求(親要求もスコープもない)に対して worker が配信した割り込みだけです。アプリケーションが作成した割り込みやラップされた割り込みを含め、それ以外はすべて `failed` として記録されます。Server がマーカーを受け付けるのは、run のエンジン所有のタイムアウト要求が有効な間だけで、`timeout_cleanup` をネゴシエートした claim からのものに限られます。Workflow 2.42.0 はこの規則を[ポータブル契約](https://github.com/durable-workflow/workflow/blob/main/docs/architecture/timeout-cleanup.md)に記載しています。 + +**混在キュー。** 受け付け時には、タスクキュー上の live worker のうち少なくとも 1 つが `timeout_cleanup` を広告していることだけを確認し、キュー上のどの worker もクリーンアップのターンを claim できます。Server は capability を広告していない worker からのマーカーを拒否するため、そこで割り込みが外に出ると `failed` または `expired` として記録されます。しかし、そのような worker は割り込みを一切配信しない可能性があります。その workflow コードが return すると、クリーンアップが実行されていなくても run はクリーンアップを `completed` として記録します。キューで有効化された run を開始する前に、そのキューのすべての worker を、協調的キャンセルを有効にした対応 SDK にアップグレードしてください。 ## ワークフロータスクのリース {#workflow-task-lease} diff --git a/i18n/ja/source-hashes.json b/i18n/ja/source-hashes.json index d830f72396f..0227204f075 100644 --- a/i18n/ja/source-hashes.json +++ b/i18n/ja/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "522cd4a24a2c6f04c774d397b481ed4aa4faf356d97bff6ea0c36656db114df0", + "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "c0d2d4108b195d10a759a4cc5368e0d13a48bde4a46005601ec15d58198f409a", + "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/sagas.md index 4c4d18024a1..b3faf943120 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/sagas.md @@ -53,7 +53,7 @@ Atividades são executadas pelo menos uma vez, então uma chamada de avanço pod Na política padrão de timeout rígido: Um [tempo limite de workflow](./timeouts.md#timeout-outcome-and-cleanup) aplicado pelo motor encerra a execução antes que seu código possa compensar. Um bloco `catch` ou `finally` não muda esse comportamento. Os comandos imediatos `cancel()` e `terminate()` também não dão tempo para a limpeza. -A [opção experimental de limpeza por timeout](./timeouts.md#timeout-cleanup) pode reservar tempo dentro do limite rígido original para um handler de compensação acionado por interrupção. É suporte experimental para workers de fila embutidos, disponível no Workflow 2.29.0 e posteriores e ainda sem promessa de compatibilidade retroativa; inícios em modo de serviço e poll o recusam. Não torna a compensação automática nem garante efeitos sem workers disponíveis. +A [opção experimental de limpeza por timeout](./timeouts.md#timeout-cleanup) pode reservar tempo dentro do limite rígido original para um handler de compensação acionado por interrupção. Ela é experimental e ainda não tem promessa de compatibilidade retroativa. Workers de fila embutidos a suportam a partir do Workflow 2.29.0 (inícios embutidos em modo poll a recusam), e o modo de serviço a suporta a partir do Server nativo 3.30.0 com workers de SDK compatíveis. Não torna a compensação automática nem garante efeitos sem workers disponíveis. Use um prazo anterior da aplicação quando quiser desfazer o trabalho concluído ao esgotar o tempo. Este workflow incorporado reserva um recurso e espera até 30 segundos por um sinal de confirmação. Ao vencer, o código do workflow retoma, libera a reserva e retorna o resultado de negócio `expired`: diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/timeouts.md index 0b8eb107154..7c0e8a93e02 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -137,9 +137,9 @@ Os comandos imediatos `cancel()` e `terminate()` também encerram a execução s ## Limpeza experimental acionada pelo prazo {#timeout-cleanup} -**Suporte embutido experimental.** Disponível no Workflow 2.29.0 e posteriores apenas para workers de fila embutidos; inícios em modo de serviço e poll recusam a opção. A opção é uma superfície `experimental` segundo os [níveis de estabilidade](../compatibility.md#stability-levels), ainda sem promessa de compatibilidade retroativa. Runs que não a ativam mantêm o timeout rígido padrão descrito acima. +**Experimental.** Workers de fila embutidos suportam esta opção a partir do Workflow 2.29.0; inícios embutidos em modo poll a recusam. O modo de serviço a suporta a partir do Server nativo 3.30.0 com workers compatíveis, como descrito abaixo. A opção é uma superfície `experimental` segundo os [níveis de estabilidade](../compatibility.md#stability-levels), ainda sem promessa de compatibilidade retroativa. Runs que não a ativam mantêm o timeout rígido padrão descrito acima. -Antes de ativar a opção, instale o Workflow 2.29.0 ou posterior, execute as migrações da aplicação e implante workers de fila embutidos compatíveis. A nova migração adiciona `workflow_runs.timeout_cleanup_work_deadline_at`; não ativa a opção em runs existentes. Não habilite antes de a migração terminar. +Antes de ativar a opção no modo embutido, instale o Workflow 2.29.0 ou posterior, execute as migrações da aplicação e implante workers de fila embutidos compatíveis. A nova migração adiciona `workflow_runs.timeout_cleanup_work_deadline_at`; não ativa a opção em runs existentes. Não habilite antes de a migração terminar. ```bash php artisan migrate @@ -176,11 +176,17 @@ A limpeza tem um `timeout_cleanup.outcome` separado: Limpeza concluída, falha ou expirada ainda termina com status de negócio `failed`, `closed_reason = timed_out` e `WorkflowTimedOut`. Compensar com sucesso não transforma o timeout em workflow bem-sucedido. Quando a limpeza termina antes, o run fecha imediatamente, mas a mensagem de timeout ainda cita o horário do prazo rígido original. -Leia o resultado da limpeza no histórico. O payload `timeout_cleanup` do evento terminal `WorkflowTimedOut`, `WorkflowTerminated` ou `WorkflowCancelled`, também incluído na saída de `php artisan workflow:v2:history-export`, é o registro oficial. A saída de describe do control plane e o resumo do run não trazem o resultado da limpeza, e o detalhe do run mostra no máximo uma nota como "Timeout cleanup failed." (nada para `preempted`). +Leia o resultado da limpeza no histórico. O payload `timeout_cleanup` do evento terminal `WorkflowTimedOut`, `WorkflowTerminated` ou `WorkflowCancelled`, também incluído na saída de `php artisan workflow:v2:history-export`, é o registro oficial. A partir do Workflow 2.40.0, e no Server nativo 3.30.0 ou posterior, describe informa o estado registrado em `run.timeout_cleanup`, e o detalhe do run e a observação limitada do run que o Waterline lê o informam como `timeout_cleanup` de nível superior. Enquanto a limpeza está aberta, ele mostra `outcome: running` com `cause: timeout`, o tipo de timeout, o horário da detecção e os prazos de trabalho e de limpeza. Após o encerramento, mostra o resultado terminal, com `failure_id` para `failed`. O campo é omitido quando nenhuma limpeza foi registrada. Workers indisponíveis ou atrasados não garantem um efeito externo de limpeza; mantenha compensações idempotentes e reconcilie efeitos incertos na aplicação. -Este incremento só suporta workers de fila embutidos. Inícios poll e de serviço recusam a opção; workers bridge não podem reclamar um run embutido com ela ativada. Admissão nativa e entrega de runtime pelos SDKs seguem pendentes em [Server #1201](https://github.com/durable-workflow/server/issues/1201); suporte ao parser sozinho não implementa limpeza por timeout. +No modo embutido, workers bridge não podem reclamar um run com a opção ativada; a reclamação retorna `timeout_cleanup_not_supported` sem assumir o lease. + +**Modo de serviço.** O Server nativo 3.30.0 e posteriores aceita `timeout_cleanup_seconds` em inícios de serviço e em comandos `start_child_workflow`, com os mesmos limites da reserva embutida, e anuncia `timeout_cleanup: {supported: true, version: 1}`. Ele só admite um início com a opção quando um worker ativo na fila de tarefas anuncia a capacidade. Caso contrário, responde `422 timeout_cleanup_not_supported`, não grava nada e nunca recorre a um timeout rígido simples. Workers com cancelamento cooperativo habilitado anunciam a capacidade a partir do PHP SDK 3.31.0 (3.32.0 para a regra de marcador mais estrita abaixo), Python SDK 2.24.0 e Rust SDK 4.25.0. O código do workflow recebe a interrupção de cancelamento cooperativo do SDK com `cause: timeout`. Veja [Cancelamento cooperativo](../polyglot/cancellation.md). + +Para autores de SDK: um worker de serviço informa uma interrupção de limpeza não capturada ou relançada com `fail_workflow.failure.interruption: "timeout_cleanup"`, e somente para a interrupção que entregou para a solicitação de timeout raiz do run (sem solicitação pai e sem scope). Qualquer outra coisa, inclusive uma interrupção construída pela aplicação ou encapsulada, registra `failed`. O Server aceita o marcador somente enquanto a solicitação de timeout pertencente ao engine estiver ativa e somente de uma reclamação que negociou `timeout_cleanup`. O Workflow 2.42.0 descreve essa regra no [contrato portável](https://github.com/durable-workflow/workflow/blob/main/docs/architecture/timeout-cleanup.md). + +**Filas mistas.** A admissão verifica apenas se pelo menos um worker ativo na fila de tarefas anuncia `timeout_cleanup`; qualquer worker da fila pode reclamar o turno de limpeza. O Server recusa o marcador de um worker que não anunciou a capacidade, então uma interrupção que escapa ali é registrada como `failed` ou `expired`. Mas esse worker pode nunca entregar a interrupção: se o código do workflow retornar, o run registra a limpeza como `completed` embora nenhuma limpeza tenha sido executada. Antes de iniciar runs com a opção em uma fila, atualize todos os workers dela para um SDK compatível com o cancelamento cooperativo habilitado. ## Lease de uma tarefa de workflow {#workflow-task-lease} diff --git a/i18n/pt-BR/source-hashes.json b/i18n/pt-BR/source-hashes.json index d830f72396f..0227204f075 100644 --- a/i18n/pt-BR/source-hashes.json +++ b/i18n/pt-BR/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "522cd4a24a2c6f04c774d397b481ed4aa4faf356d97bff6ea0c36656db114df0", + "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "c0d2d4108b195d10a759a4cc5368e0d13a48bde4a46005601ec15d58198f409a", + "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/uk/docusaurus-plugin-content-docs/current/features/sagas.md index df5d9da1e0d..fb9b532fc34 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/features/sagas.md @@ -58,7 +58,7 @@ Activity виконуються щонайменше один раз, тому або `finally` цього не змінює. Негайні команди `cancel()` і `terminate()` також не надають вікна для очищення. -Окрема [експериментальна опція очищення за тайм-аутом](./timeouts.md#timeout-cleanup) може зарезервувати час усередині початкової жорсткої межі для обробника компенсації, викликаного перериванням. Це експериментальна підтримка вбудованих воркерів черги, доступна з Workflow 2.29.0 і поки без гарантії зворотної сумісності; запуски в режимі сервісу та poll її відхиляють. Компенсація не стає автоматичною і без доступних воркерів ефект не гарантується. +Окрема [експериментальна опція очищення за тайм-аутом](./timeouts.md#timeout-cleanup) може зарезервувати час усередині початкової жорсткої межі для обробника компенсації, викликаного перериванням. Вона експериментальна і поки без гарантії зворотної сумісності. Вбудовані воркери черги підтримують її з Workflow 2.29.0 (вбудовані запуски в режимі poll її відхиляють), а режим сервісу — з нативного Server 3.30.0 із сумісними воркерами SDK. Компенсація не стає автоматичною і без доступних воркерів ефект не гарантується. Якщо сплив часу має скасувати вже виконану роботу, задайте раніший прикладний термін. Цей вбудований workflow резервує ресурс і до 30 секунд чекає на signal diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/uk/docusaurus-plugin-content-docs/current/features/timeouts.md index 472b1f495f4..bcf5158e3e2 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -154,9 +154,9 @@ shield не подовжує кінцевий термін виконання ч ## Експериментальне очищення за кінцевим терміном {#timeout-cleanup} -**Експериментальна вбудована підтримка.** Доступна з Workflow 2.29.0 лише для вбудованих воркерів черги; запуски в режимі сервісу та poll відхиляють опцію. Опція є поверхнею `experimental` за [рівнями стабільності](../compatibility.md#stability-levels) і поки не має гарантії зворотної сумісності. Запуски без цієї опції зберігають описаний вище типовий жорсткий тайм-аут. +**Експериментально.** Вбудовані воркери черги підтримують цю опцію з Workflow 2.29.0; вбудовані запуски в режимі poll її відхиляють. Режим сервісу підтримує її з нативного Server 3.30.0 із сумісними воркерами, як описано нижче. Опція є поверхнею `experimental` за [рівнями стабільності](../compatibility.md#stability-levels) і поки не має гарантії зворотної сумісності. Запуски без цієї опції зберігають описаний вище типовий жорсткий тайм-аут. -Перед увімкненням установіть Workflow 2.29.0 або новішу версію, виконайте міграції застосунку та розгорніть сумісні вбудовані воркери черги. Нова міграція додає `workflow_runs.timeout_cleanup_work_deadline_at`; вона не вмикає опцію для наявних запусків. Не вмикайте її до завершення міграції. +Перед увімкненням у вбудованому режимі установіть Workflow 2.29.0 або новішу версію, виконайте міграції застосунку та розгорніть сумісні вбудовані воркери черги. Нова міграція додає `workflow_runs.timeout_cleanup_work_deadline_at`; вона не вмикає опцію для наявних запусків. Не вмикайте її до завершення міграції. ```bash php artisan migrate @@ -193,11 +193,17 @@ WorkflowStub::make(MyWorkflow::class, 'order-123')->start( Завершене, невдале чи прострочене очищення все одно має бізнес-статус `failed`, `closed_reason = timed_out` і `WorkflowTimedOut`. Успішна компенсація не перетворює тайм-аут на успішний workflow. Якщо очищення завершується раніше, запуск закривається одразу, але повідомлення про тайм-аут усе одно вказує час початкового жорсткого терміну. -Читайте результат очищення з історії. Payload `timeout_cleanup` у термінальній події `WorkflowTimedOut`, `WorkflowTerminated` або `WorkflowCancelled`, який також є у виводі `php artisan workflow:v2:history-export`, є авторитетним записом. Вивід describe площини керування та підсумок запуску не містять результату очищення, а деталі запуску показують щонайбільше примітку на кшталт «Timeout cleanup failed.» (для `preempted` — нічого). +Читайте результат очищення з історії. Payload `timeout_cleanup` у термінальній події `WorkflowTimedOut`, `WorkflowTerminated` або `WorkflowCancelled`, який також є у виводі `php artisan workflow:v2:history-export`, є авторитетним записом. Починаючи з Workflow 2.40.0, а також у нативному Server 3.30.0 і новіших, describe повідомляє записаний стан у `run.timeout_cleanup`, а деталі запуску та обмежене спостереження запуску, яке читає Waterline, повідомляють його як `timeout_cleanup` верхнього рівня. Поки очищення відкрите, поле показує `outcome: running` з `cause: timeout`, вид тайм-ауту, час виявлення та робочий і кінцевий терміни очищення. Після закриття воно показує термінальний результат, для `failed` — з `failure_id`. Якщо очищення не записано, поле відсутнє. Недоступні чи затримані воркери не гарантують зовнішнього ефекту очищення; робіть компенсації ідемпотентними та звіряйте невизначені ефекти в застосунку. -Цей інкремент підтримує лише вбудовані воркери черги. Старти poll і service відхиляють опцію; bridge-воркери не можуть отримати вбудований запуск, що її увімкнув. Нативна admission і доставка виконання SDK залишаються в [Server #1201](https://github.com/durable-workflow/server/issues/1201); сам parser не реалізує очищення за тайм-аутом. +У вбудованому режимі bridge-воркери не можуть отримати запуск, що увімкнув опцію; claim повертає `timeout_cleanup_not_supported`, не забираючи lease. + +**Режим сервісу.** Нативний Server 3.30.0 і новіші приймають `timeout_cleanup_seconds` у сервісних запусках і командах `start_child_workflow` з тими самими обмеженнями, що й для вбудованого резерву, та оголошують `timeout_cleanup: {supported: true, version: 1}`. Server допускає запуск з опцією, лише коли активний воркер у черзі завдань оголошує цю можливість. Інакше він відповідає `422 timeout_cleanup_not_supported`, нічого не записує і ніколи не переходить на простий жорсткий тайм-аут. Воркери з увімкненим кооперативним скасуванням оголошують можливість починаючи з PHP SDK 3.31.0 (3.32.0 для суворішого правила маркера нижче), Python SDK 2.24.0 і Rust SDK 4.25.0. Код workflow отримує переривання кооперативного скасування свого SDK з `cause: timeout`. Див. [Cooperative Cancellation](../polyglot/cancellation.md). + +Для авторів SDK: сервісний воркер повідомляє неперехоплене або повторно кинуте переривання очищення через `fail_workflow.failure.interruption: "timeout_cleanup"`, і лише для переривання, яке він доставив для кореневого запиту тайм-ауту запуску (без батьківського запиту та без scope). Усе інше, зокрема переривання, створене застосунком або обгорнуте, записує `failed`. Server приймає маркер лише поки активний запит тайм-ауту, що належить рушію, і лише від claim, який узгодив `timeout_cleanup`. Workflow 2.42.0 формулює це правило в [портативному контракті](https://github.com/durable-workflow/workflow/blob/main/docs/architecture/timeout-cleanup.md). + +**Змішані черги.** Admission перевіряє лише те, що принаймні один активний воркер у черзі завдань оголошує `timeout_cleanup`; будь-який воркер черги може отримати хід очищення. Server відхиляє маркер від воркера, який не оголосив можливість, тож переривання, що там вийшло назовні, записується як `failed` або `expired`. Але такий воркер може взагалі не доставити переривання: якщо його код workflow повертає значення, запуск записує очищення як `completed`, хоча жодного очищення не було. Перш ніж запускати workflow з опцією в черзі, оновіть усі її воркери до сумісного SDK з увімкненим кооперативним скасуванням. ## Lease для workflow task {#workflow-task-lease} diff --git a/i18n/uk/source-hashes.json b/i18n/uk/source-hashes.json index d830f72396f..0227204f075 100644 --- a/i18n/uk/source-hashes.json +++ b/i18n/uk/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "522cd4a24a2c6f04c774d397b481ed4aa4faf356d97bff6ea0c36656db114df0", + "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "c0d2d4108b195d10a759a4cc5368e0d13a48bde4a46005601ec15d58198f409a", + "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/sagas.md index daa16e6e6ad..becc427a8ef 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/sagas.md @@ -51,7 +51,7 @@ class BookingSagaWorkflow extends Workflow 默认硬超时策略下,引擎[工作流超时](./timeouts.md#timeout-outcome-and-cleanup)会在工作流代码运行补偿前关闭运行。`catch` 或 `finally` 不会改变该行为。立即执行的 `cancel()` 与 `terminate()` 也不提供清理窗口。 -独立的[实验性超时清理选项](./timeouts.md#timeout-cleanup)可在原始硬上限内为中断驱动的补偿处理器预留时间。它是仅支持嵌入式队列 worker 的实验性功能,从 Workflow 2.29.0 起提供,目前不承诺向后兼容;service 和 poll 模式启动会拒绝它。它不会使补偿自动发生,也不会在 worker 不可用时保证外部效果。 +独立的[实验性超时清理选项](./timeouts.md#timeout-cleanup)可在原始硬上限内为中断驱动的补偿处理器预留时间。它是实验性功能,目前不承诺向后兼容。嵌入式队列 worker 从 Workflow 2.29.0 起支持它(嵌入式 poll 模式启动会拒绝它),service 模式从原生 Server 3.30.0 起在有受支持的 SDK worker 时支持它。它不会使补偿自动发生,也不会在 worker 不可用时保证外部效果。 如果超时应撤销已完成工作,请使用更早的应用截止时间。此嵌入式工作流先预订资源,再最多等待确认信号 30 秒。等待到期后,工作流代码恢复,释放预订,然后返回 `expired` 业务结果: diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/timeouts.md index 46c2354293f..adddd5a029a 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -135,9 +135,9 @@ $description['run']['run_deadline_at']; // ISO 8601 timestamp ## 截止时间触发的实验性清理 {#timeout-cleanup} -**实验性嵌入式支持。** 从 Workflow 2.29.0 起提供,仅适用于嵌入式队列 worker;service 和 poll 模式启动会拒绝此选项。该选项按[稳定性级别](../compatibility.md#stability-levels)属于 `experimental` 接口,目前不承诺向后兼容。未启用该选项的运行继续使用上述默认硬超时行为。 +**实验性。** 嵌入式队列 worker 从 Workflow 2.29.0 起支持此选项;嵌入式 poll 模式启动会拒绝它。service 模式从原生 Server 3.30.0 起在有支持的 worker 时提供此选项,详见下文。该选项按[稳定性级别](../compatibility.md#stability-levels)属于 `experimental` 接口,目前不承诺向后兼容。未启用该选项的运行继续使用上述默认硬超时行为。 -启用前,先安装 Workflow 2.29.0 或更高版本,运行应用 migration,并部署兼容的嵌入式队列 worker。新 migration 添加 `workflow_runs.timeout_cleanup_work_deadline_at`,不会为已有运行启用选项。migration 完成前不要启用。 +在嵌入式模式下启用前,先安装 Workflow 2.29.0 或更高版本,运行应用 migration,并部署兼容的嵌入式队列 worker。新 migration 添加 `workflow_runs.timeout_cleanup_work_deadline_at`,不会为已有运行启用选项。migration 完成前不要启用。 ```bash php artisan migrate @@ -174,11 +174,17 @@ worker 发现已到工作截止时间后,运行只进入一次清理并记录 清理完成、失败或过期后,业务状态仍是 `failed`、`closed_reason = timed_out` 和 `WorkflowTimedOut`。补偿成功不会把超时变为 workflow 成功。清理提前完成时,运行会立即关闭,但超时消息仍引用原始硬截止时间。 -请从历史读取清理结果。终止事件 `WorkflowTimedOut`、`WorkflowTerminated` 或 `WorkflowCancelled` 上的 `timeout_cleanup` 载荷是权威记录,也包含在 `php artisan workflow:v2:history-export` 的输出中。control plane 的 describe 输出和运行摘要不包含清理结果,run detail 最多显示类似“Timeout cleanup failed.”的说明(`preempted` 时不显示)。 +请从历史读取清理结果。终止事件 `WorkflowTimedOut`、`WorkflowTerminated` 或 `WorkflowCancelled` 上的 `timeout_cleanup` 载荷是权威记录,也包含在 `php artisan workflow:v2:history-export` 的输出中。从 Workflow 2.40.0 起,以及在原生 Server 3.30.0 及更高版本上,describe 在 `run.timeout_cleanup` 下报告已记录的清理状态,run detail 和 Waterline 读取的有界运行观察则以顶层 `timeout_cleanup` 报告。清理进行中时,它显示 `outcome: running`、`cause: timeout`、超时类型、检测时间以及工作截止时间和清理截止时间。关闭后,它显示终态结果,`failed` 时附带 `failure_id`。未记录清理时省略该字段。 不可用或延迟的 worker 无法保证外部清理效果;补偿必须幂等,并由应用核对不确定的效果。 -本增量仅支持嵌入式队列 worker。poll 和 service 启动会拒绝此选项;bridge worker 无法 claim 已启用的嵌入式运行。原生接纳及 SDK runtime 交付仍由 [Server #1201](https://github.com/durable-workflow/server/issues/1201) 跟踪;仅有 parser 支持不代表实现超时清理。 +在嵌入式模式下,bridge worker 无法 claim 已启用的运行;claim 会返回 `timeout_cleanup_not_supported`,且不获取租约。 + +**Service 模式。** 原生 Server 3.30.0 及更高版本在 service 启动和 `start_child_workflow` 命令中接受 `timeout_cleanup_seconds`,限制与嵌入式预留相同,并宣告 `timeout_cleanup: {supported: true, version: 1}`。只有当任务队列上有在线 worker 宣告该能力时,它才接纳启用此选项的启动。否则返回 `422 timeout_cleanup_not_supported`,不写入任何内容,也绝不回退为普通硬超时。启用协作式取消的 worker 从 PHP SDK 3.31.0(下文更严格的标记规则需要 3.32.0)、Python SDK 2.24.0 和 Rust SDK 4.25.0 起宣告该能力。工作流代码会收到 SDK 的协作式取消中断,其 `cause` 为 `timeout`。参见[协作式取消](../polyglot/cancellation.md)。 + +面向 SDK 作者:service worker 用 `fail_workflow.failure.interruption: "timeout_cleanup"` 报告未捕获或重新抛出的清理中断,且仅针对它为运行的根超时请求(无父请求、无 scope)投递的那个中断。其他任何情况,包括应用自行构造或包装后的中断,都记录为 `failed`。Server 仅在运行中由引擎拥有的超时请求仍处于活动状态时,且仅从协商了 `timeout_cleanup` 的 claim 接受该标记。Workflow 2.42.0 在[可移植契约](https://github.com/durable-workflow/workflow/blob/main/docs/architecture/timeout-cleanup.md)中说明了这一规则。 + +**混合队列。** 接纳只检查任务队列上是否至少有一个在线 worker 宣告 `timeout_cleanup`;队列上的任何 worker 都可以 claim 清理回合。Server 会拒绝未宣告该能力的 worker 发送的标记,因此在那里逃逸的中断会记录为 `failed` 或 `expired`。但这样的 worker 可能根本不会投递该中断:如果其工作流代码直接返回,运行会把清理记录为 `completed`,尽管并未执行任何清理。在某个队列上启动启用此选项的运行之前,请将该队列上的所有 worker 升级到启用协作式取消的受支持 SDK。 ## 工作流任务租约 {#workflow-task-lease} diff --git a/i18n/zh-Hans/source-hashes.json b/i18n/zh-Hans/source-hashes.json index d830f72396f..0227204f075 100644 --- a/i18n/zh-Hans/source-hashes.json +++ b/i18n/zh-Hans/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "522cd4a24a2c6f04c774d397b481ed4aa4faf356d97bff6ea0c36656db114df0", + "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "c0d2d4108b195d10a759a4cc5368e0d13a48bde4a46005601ec15d58198f409a", + "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", From f7d9c2a393da077be1206d8a49a43d04c917ddc6 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Thu, 26 Nov 2026 17:48:16 +0000 Subject: [PATCH 2/2] State that completed timeout cleanup does not prove cleanup ran The interruption reaches workflow code only at the next durable wait whose result was not already in history, so code can return without it and still record completed. Add that caveat from the portable contract, with how to spot it in history and where to run compensation; reword the completed and preempted rows; note that list views don't show cleanup state yet; and link the saga guide to the caveat. Translate into every offered locale and record the new source hashes. Refs durable-workflow/workflow#863 Co-Authored-By: Claude Opus 5.5 --- docs/features/sagas.md | 3 +- docs/features/timeouts.md | 43 +++++++++++++------ .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 10 +++-- i18n/de/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 10 +++-- i18n/es/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 10 +++-- i18n/fr/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 10 +++-- i18n/ja/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 10 +++-- i18n/pt-BR/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 10 +++-- i18n/uk/source-hashes.json | 4 +- .../current/features/sagas.md | 2 +- .../current/features/timeouts.md | 10 +++-- i18n/zh-Hans/source-hashes.json | 4 +- 23 files changed, 94 insertions(+), 64 deletions(-) diff --git a/docs/features/sagas.md b/docs/features/sagas.md index 09ccf19fb69..a803bbd94d8 100644 --- a/docs/features/sagas.md +++ b/docs/features/sagas.md @@ -64,7 +64,8 @@ original hard cap. It is experimental, with no backward-compatibility promise yet. Embedded queue workers support it from Workflow 2.29.0 (embedded poll-mode starts refuse it), and service mode supports it from native Server 3.30.0 with supporting SDK workers. It does not make compensation automatic or guarantee an -effect when workers are unavailable. +effect when workers are unavailable, and a `completed` cleanup outcome +[does not prove cleanup code ran](./timeouts.md#timeout-cleanup). Use an earlier application deadline when timeout should undo completed work. This embedded workflow reserves a resource, then waits up to 30 seconds for a diff --git a/docs/features/timeouts.md b/docs/features/timeouts.md index cb1f745f0a3..80fa60ca7a7 100644 --- a/docs/features/timeouts.md +++ b/docs/features/timeouts.md @@ -164,7 +164,8 @@ hard-timeout behavior above. Before enabling this option in embedded mode, install Workflow 2.29.0 or later, run the application migrations, and deploy compatible embedded queue workers. The new migration adds `workflow_runs.timeout_cleanup_work_deadline_at`; it -does not opt existing runs in. Do not enable the option before the migration completes. +does not opt existing runs in. Do not enable the option before the migration +completes. ```bash php artisan migrate @@ -200,8 +201,8 @@ allowance and original execution clocks; each run derives its own run clocks. When a worker observes the work deadline, the run enters cleanup once and records `WorkflowTimeoutCleanupStarted`. If no worker observes it before the hard deadline, that event is never written and the `expired` outcome has no -`started_at`. Compatible workflow code receives -`WorkflowTimeoutCleanupRequested`, a subtype of +`started_at`. At its next unresolved durable wait, compatible workflow code +receives `WorkflowTimeoutCleanupRequested`, a subtype of `WorkflowCancellationRequestedException` with cancellation `cause: timeout`. Handle that interruption to run registered saga compensation or protected cleanup; `compensate()` uses its cancellation shield. The shield does not @@ -211,10 +212,23 @@ Cleanup has a separate `timeout_cleanup.outcome`: | Outcome | Meaning | |---|---| -| `completed` | Workflow cleanup returned or rethrew the timeout interruption before its deadline. A returned value does not become the business result. | +| `completed` | Workflow code returned, or rethrew the timeout interruption, before the cleanup deadline. It does not prove cleanup code ran. A returned value does not become the business result. | | `failed` | Cleanup threw another exception; `failure_id` links the cleanup failure. | | `expired` | The hard cap arrived before cleanup finished, including when no worker could run it. | -| `preempted` | Immediate `cancel()` or `terminate()` interrupted cleanup; the corresponding cancellation/termination outcome remains terminal. | +| `preempted` | Immediate `cancel()` or `terminate()`, or a hard deadline before the cleanup deadline, interrupted cleanup; the preempting outcome remains terminal. | + +`completed` does not prove that cleanup code ran, in embedded and service mode +alike. The interruption is delivered at the next durable wait (activity, +timer, child, signal, condition or selection) whose result was not already in +history when cleanup started, never in a side effect or inside +`cancellationShield()`. If the wait the workflow is blocked on had already +resolved, for example a timer that fired or an activity that completed, +workflow code can return without receiving the interruption, and the outcome +is still `completed`. History then shows `WorkflowTimeoutCleanupStarted` with +no `CooperativeCancellationDelivered` after it. Make compensation that must +always run idempotent, and run it on every path that can return after the work +deadline, for example by comparing workflow time with the deadline the run was +admitted with, not only in the interruption handler. Completed, failed or expired cleanup still ends with business status `failed`, `closed_reason = timed_out` and `WorkflowTimedOut`. Successful compensation does @@ -232,6 +246,7 @@ top-level `timeout_cleanup`. While cleanup is open, it shows `outcome: running` with `cause: timeout`, the timeout kind, the detection time and the work and cleanup deadlines. After closure, it shows the terminal outcome, with `failure_id` for `failed`. The field is omitted when no cleanup was recorded. +List views do not show the cleanup state yet, so open run detail. Unavailable or delayed workers cannot guarantee an external cleanup effect; keep compensation idempotent and reconcile uncertain effects in your application. @@ -241,15 +256,15 @@ returns `timeout_cleanup_not_supported` without taking the lease. **Service mode.** Native Server 3.30.0 and later accepts `timeout_cleanup_seconds` on service starts and `start_child_workflow` -commands, with the same limits as the embedded allowance, and advertises `timeout_cleanup: {supported: true, version: 1}`. -It admits an opted-in start only when a live worker on the task queue -advertises the capability. Otherwise it answers -`422 timeout_cleanup_not_supported`, writes nothing and never falls back to a -plain hard timeout. Workers with cooperative cancellation enabled advertise -the capability from PHP SDK 3.31.0 (3.32.0 for the stricter marker rule -below), Python SDK 2.24.0 and Rust SDK 4.25.0. Workflow code receives the -SDK's cooperative-cancellation interruption with `cause: timeout`. See -[Cooperative Cancellation](../polyglot/cancellation.md). +commands, with the same limits as the embedded allowance, and advertises +`timeout_cleanup: {supported: true, version: 1}`. It admits an opted-in start +only when a live worker on the task queue advertises the capability. +Otherwise it answers `422 timeout_cleanup_not_supported`, writes nothing and +never falls back to a plain hard timeout. Workers with cooperative +cancellation enabled advertise the capability from PHP SDK 3.31.0 (3.32.0 for +the stricter marker rule below), Python SDK 2.24.0 and Rust SDK 4.25.0. +Workflow code receives the SDK's cooperative-cancellation interruption with +`cause: timeout`. See [Cooperative Cancellation](../polyglot/cancellation.md). For SDK authors: a service worker reports an uncaught or rethrown cleanup interruption with `fail_workflow.failure.interruption: "timeout_cleanup"`, and diff --git a/i18n/de/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/de/docusaurus-plugin-content-docs/current/features/sagas.md index 38721fe1e95..7ac78bddc9a 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/features/sagas.md @@ -53,7 +53,7 @@ Aktivitäten laufen mindestens einmal. Ein vorwärts gerichteter Aufruf kann dah Bei der standardmäßigen harten Timeout-Regel gilt: Ein von der Engine durchgesetztes [Workflow-Zeitlimit](./timeouts.md#timeout-outcome-and-cleanup) schließt den Lauf, bevor Workflow-Code Kompensation ausführen kann. Ein `catch`- oder `finally`-Block ändert dies nicht. Auch die unmittelbaren Befehle `cancel()` und `terminate()` bieten kein Aufräumfenster. -Die separate [experimentelle Timeout-Cleanup-Option](./timeouts.md#timeout-cleanup) kann innerhalb der ursprünglichen harten Grenze Zeit für einen durch Unterbrechung ausgelösten Kompensationshandler reservieren. Sie ist experimentell und hat noch keine Zusage zur Abwärtskompatibilität. Embedded-Queue-Worker unterstützen sie ab Workflow 2.29.0 (Embedded-Poll-Starts lehnen sie ab), der Service-Modus ab nativem Server 3.30.0 mit unterstützenden SDK-Workern. Sie macht Kompensation nicht automatisch und garantiert bei fehlenden Workern keine Wirkung. +Die separate [experimentelle Timeout-Cleanup-Option](./timeouts.md#timeout-cleanup) kann innerhalb der ursprünglichen harten Grenze Zeit für einen durch Unterbrechung ausgelösten Kompensationshandler reservieren. Sie ist experimentell und hat noch keine Zusage zur Abwärtskompatibilität. Embedded-Queue-Worker unterstützen sie ab Workflow 2.29.0 (Embedded-Poll-Starts lehnen sie ab), der Service-Modus ab nativem Server 3.30.0 mit unterstützenden SDK-Workern. Sie macht Kompensation nicht automatisch und garantiert bei fehlenden Workern keine Wirkung, und ein Cleanup-Ergebnis `completed` [beweist nicht, dass Cleanup-Code lief](./timeouts.md#timeout-cleanup). Verwenden Sie eine frühere Anwendungsfrist, wenn bei Ablauf bereits erledigte Arbeit zurückgenommen werden soll. Dieser eingebettete Workflow reserviert eine Ressource und wartet danach höchstens 30 Sekunden auf ein Bestätigungssignal. Bei Ablauf wird Workflow-Code fortgesetzt, der die Reservierung vor Rückgabe des fachlichen Ergebnisses `expired` freigibt: diff --git a/i18n/de/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/de/docusaurus-plugin-content-docs/current/features/timeouts.md index bccf1aa43e8..46dd1b741b2 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -163,20 +163,22 @@ Verketten Sie `withTimeoutCleanup()` nach `withExecutionTimeout()` oder `withRun Im Beispiel erhält normale Arbeit 60 Sekunden; Cleanup darf die letzten 10 Sekunden innerhalb der ursprünglichen harten 70-Sekunden-Grenze nutzen. Das Budget fügt nach dieser Grenze keine Zeit hinzu. Gelten beide harten Deadlines, begrenzt die frühere das Cleanup. Späte Erkennung, Retries, Worker-Austausch und Lease-Verlängerung verschieben keine Deadline. Continue-as-new und Redrive erhalten das aufgenommene Budget und die ursprünglichen Ausführungsuhren; jeder Run leitet seine eigenen Run-Uhren ab. -Sobald ein Worker die Arbeitsdeadline bemerkt, wechselt der Run einmal ins Cleanup und zeichnet `WorkflowTimeoutCleanupStarted` auf. Bemerkt kein Worker sie vor der harten Deadline, wird dieses Ereignis nie geschrieben, und das Ergebnis `expired` hat kein `started_at`. Kompatibler Workflow-Code erhält `WorkflowTimeoutCleanupRequested`, einen Untertyp von `WorkflowCancellationRequestedException` mit Cancellation-`cause: timeout`. Behandeln Sie diese Unterbrechung für registrierte Saga-Kompensation oder geschütztes Cleanup; `compensate()` nutzt seinen Cancellation-Shield. Der Shield verlängert die harte Grenze nicht. Siehe [Sagas](./sagas.md#deadline-driven-compensation). +Sobald ein Worker die Arbeitsdeadline bemerkt, wechselt der Run einmal ins Cleanup und zeichnet `WorkflowTimeoutCleanupStarted` auf. Bemerkt kein Worker sie vor der harten Deadline, wird dieses Ereignis nie geschrieben, und das Ergebnis `expired` hat kein `started_at`. An seinem nächsten unaufgelösten dauerhaften Warten erhält kompatibler Workflow-Code `WorkflowTimeoutCleanupRequested`, einen Untertyp von `WorkflowCancellationRequestedException` mit Cancellation-`cause: timeout`. Behandeln Sie diese Unterbrechung für registrierte Saga-Kompensation oder geschütztes Cleanup; `compensate()` nutzt seinen Cancellation-Shield. Der Shield verlängert die harte Grenze nicht. Siehe [Sagas](./sagas.md#deadline-driven-compensation). Cleanup hat ein separates `timeout_cleanup.outcome`: | Ergebnis | Bedeutung | |---|---| -| `completed` | Cleanup kehrte vor seiner Deadline zurück oder warf die Timeout-Unterbrechung erneut. Ein Rückgabewert wird nicht zum Geschäftsergebnis. | +| `completed` | Workflow-Code kehrte vor der Cleanup-Deadline zurück oder warf die Timeout-Unterbrechung erneut. Das beweist nicht, dass Cleanup-Code lief. Ein Rückgabewert wird nicht zum Geschäftsergebnis. | | `failed` | Cleanup warf eine andere Ausnahme; `failure_id` verknüpft den Cleanup-Fehler. | | `expired` | Die harte Grenze trat vor dem Cleanup-Ende ein, auch wenn kein Worker es ausführen konnte. | -| `preempted` | Sofortiges `cancel()` oder `terminate()` unterbrach Cleanup; das entsprechende Cancellation-/Terminierungsergebnis bleibt terminal. | +| `preempted` | Sofortiges `cancel()` oder `terminate()` oder eine harte Deadline vor der Cleanup-Deadline unterbrach Cleanup; das vorrangige Ergebnis bleibt terminal. | + +`completed` beweist nicht, dass Cleanup-Code lief, im Embedded- wie im Service-Modus. Die Unterbrechung wird beim nächsten dauerhaften Warten zugestellt (Aktivität, Timer, Child, Signal, Bedingung oder Auswahl), dessen Ergebnis beim Start des Cleanups noch nicht im Verlauf stand, nie in einem Side Effect oder innerhalb von `cancellationShield()`. War das Warten, auf dem der Workflow blockiert, bereits aufgelöst, etwa ein abgelaufener Timer oder eine abgeschlossene Aktivität, kann Workflow-Code ohne die Unterbrechung zurückkehren, und das Ergebnis ist trotzdem `completed`. Der Verlauf zeigt dann `WorkflowTimeoutCleanupStarted` ohne nachfolgendes `CooperativeCancellationDelivered`. Machen Sie Kompensation, die immer laufen muss, idempotent und führen Sie sie auf jedem Pfad aus, der nach der Arbeitsdeadline zurückkehren kann, zum Beispiel durch Vergleich der Workflow-Zeit mit der beim Start aufgenommenen Deadline, nicht nur im Unterbrechungshandler. Abgeschlossenes, fehlgeschlagenes oder abgelaufenes Cleanup endet weiterhin mit Geschäftsstatus `failed`, `closed_reason = timed_out` und `WorkflowTimedOut`. Erfolgreiche Kompensation macht daraus keinen erfolgreichen Workflow. Wird Cleanup früh abgeschlossen, schließt der Run sofort, die Timeout-Meldung nennt aber weiterhin den Zeitpunkt der ursprünglichen harten Deadline. -Lesen Sie das Cleanup-Ergebnis aus dem Verlauf. Die `timeout_cleanup`-Payload am terminalen Ereignis `WorkflowTimedOut`, `WorkflowTerminated` oder `WorkflowCancelled`, die auch in der Ausgabe von `php artisan workflow:v2:history-export` enthalten ist, ist der maßgebliche Nachweis. Ab Workflow 2.40.0 und auf nativem Server 3.30.0 oder neuer meldet Describe den aufgezeichneten Zustand unter `run.timeout_cleanup`; Run-Details und die begrenzte Run-Beobachtung, die Waterline liest, melden ihn als `timeout_cleanup` auf oberster Ebene. Solange Cleanup läuft, zeigt das Feld `outcome: running` mit `cause: timeout`, der Timeout-Art, dem Erkennungszeitpunkt sowie der Arbeits- und der Cleanup-Deadline. Nach dem Abschluss zeigt es das terminale Ergebnis, bei `failed` mit `failure_id`. Wurde kein Cleanup aufgezeichnet, fehlt das Feld. +Lesen Sie das Cleanup-Ergebnis aus dem Verlauf. Die `timeout_cleanup`-Payload am terminalen Ereignis `WorkflowTimedOut`, `WorkflowTerminated` oder `WorkflowCancelled`, die auch in der Ausgabe von `php artisan workflow:v2:history-export` enthalten ist, ist der maßgebliche Nachweis. Ab Workflow 2.40.0 und auf nativem Server 3.30.0 oder neuer meldet Describe den aufgezeichneten Zustand unter `run.timeout_cleanup`; Run-Details und die begrenzte Run-Beobachtung, die Waterline liest, melden ihn als `timeout_cleanup` auf oberster Ebene. Solange Cleanup läuft, zeigt das Feld `outcome: running` mit `cause: timeout`, der Timeout-Art, dem Erkennungszeitpunkt sowie der Arbeits- und der Cleanup-Deadline. Nach dem Abschluss zeigt es das terminale Ergebnis, bei `failed` mit `failure_id`. Wurde kein Cleanup aufgezeichnet, fehlt das Feld. Listenansichten zeigen den Cleanup-Zustand noch nicht; öffnen Sie daher die Run-Details. Fehlende oder verzögerte Worker können keine externe Cleanup-Wirkung garantieren; halten Sie Kompensation idempotent und gleichen Sie unsichere Wirkungen in der Anwendung ab. diff --git a/i18n/de/source-hashes.json b/i18n/de/source-hashes.json index 0227204f075..ac4f3ad94ef 100644 --- a/i18n/de/source-hashes.json +++ b/i18n/de/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", + "features/sagas.md": "e3727079c1743996d30a157e18c1b668226416cca51956b286aa1bc9e59d0e14", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", + "features/timeouts.md": "69aa0ffe2a913fc7a8a9fd32513d859ef1718281e49cfbdf8c9c8cc7c8c1df98", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/es/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/es/docusaurus-plugin-content-docs/current/features/sagas.md index 8fb8e244e5b..4b17c05d190 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/features/sagas.md @@ -53,7 +53,7 @@ Las actividades se ejecutan al menos una vez, así que una llamada de avance pue Con la política predeterminada de timeout estricto: Un [tiempo de espera de workflow](./timeouts.md#timeout-outcome-and-cleanup) aplicado por el motor cierra la ejecución antes de que su código pueda compensar. Un bloque `catch` o `finally` no cambia ese comportamiento. Las órdenes inmediatas `cancel()` y `terminate()` tampoco dan tiempo para la limpieza. -La [opción experimental de limpieza por timeout](./timeouts.md#timeout-cleanup) puede reservar tiempo dentro del límite estricto original para un manejador de compensación activado por una interrupción. Es experimental y aún no tiene promesa de compatibilidad hacia atrás. Los workers de cola embebidos la admiten desde Workflow 2.29.0 (los inicios embebidos en modo poll la rechazan), y el modo servicio la admite desde Server nativo 3.30.0 con workers de SDK compatibles. No hace automática la compensación ni garantiza efectos sin workers disponibles. +La [opción experimental de limpieza por timeout](./timeouts.md#timeout-cleanup) puede reservar tiempo dentro del límite estricto original para un manejador de compensación activado por una interrupción. Es experimental y aún no tiene promesa de compatibilidad hacia atrás. Los workers de cola embebidos la admiten desde Workflow 2.29.0 (los inicios embebidos en modo poll la rechazan), y el modo servicio la admite desde Server nativo 3.30.0 con workers de SDK compatibles. No hace automática la compensación ni garantiza efectos sin workers disponibles, y un resultado de limpieza `completed` [no prueba que el código de limpieza se ejecutara](./timeouts.md#timeout-cleanup). Use un plazo anterior de la aplicación cuando quiera revertir el trabajo completado al agotarse el tiempo. Este workflow integrado reserva un recurso y espera hasta 30 segundos una señal de confirmación. Al vencer, el código del workflow se reanuda, libera la reserva y devuelve el resultado de negocio `expired`: diff --git a/i18n/es/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/es/docusaurus-plugin-content-docs/current/features/timeouts.md index 99b3bb3d62d..efedaed4db9 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -163,20 +163,22 @@ Encadene `withTimeoutCleanup()` después de `withExecutionTimeout()` o `withRunT En el ejemplo, el trabajo ordinario dispone de 60 segundos y la limpieza puede usar los últimos 10 dentro del límite original de 70 segundos. La reserva nunca añade tiempo después de ese límite. Si se aplican ambos plazos estrictos, el anterior limita la limpieza. La detección tardía, los reintentos, el reemplazo de workers y la renovación del lease no reinician plazos. Continue-as-new y redrive conservan la reserva admitida y los relojes de ejecución originales; cada run deriva sus propios relojes. -Cuando un worker detecta el plazo de trabajo, la ejecución entra en limpieza una sola vez y registra `WorkflowTimeoutCleanupStarted`. Si ningún worker lo detecta antes del plazo estricto, ese evento nunca se escribe y el resultado `expired` no tiene `started_at`. El código compatible recibe `WorkflowTimeoutCleanupRequested`, subtipo de `WorkflowCancellationRequestedException` con `cause: timeout`. Maneje esa interrupción para ejecutar compensaciones de saga registradas o limpieza protegida; `compensate()` usa su escudo de cancelación. El escudo no amplía el límite estricto. Véase [Sagas](./sagas.md#deadline-driven-compensation). +Cuando un worker detecta el plazo de trabajo, la ejecución entra en limpieza una sola vez y registra `WorkflowTimeoutCleanupStarted`. Si ningún worker lo detecta antes del plazo estricto, ese evento nunca se escribe y el resultado `expired` no tiene `started_at`. En su siguiente espera duradera no resuelta, el código compatible recibe `WorkflowTimeoutCleanupRequested`, subtipo de `WorkflowCancellationRequestedException` con `cause: timeout`. Maneje esa interrupción para ejecutar compensaciones de saga registradas o limpieza protegida; `compensate()` usa su escudo de cancelación. El escudo no amplía el límite estricto. Véase [Sagas](./sagas.md#deadline-driven-compensation). La limpieza tiene un `timeout_cleanup.outcome` independiente: | Resultado | Significado | |---|---| -| `completed` | La limpieza retornó o relanzó la interrupción de timeout antes de su plazo. Un valor retornado no se convierte en resultado de negocio. | +| `completed` | El código del workflow retornó, o relanzó la interrupción de timeout, antes del plazo de limpieza. No prueba que el código de limpieza se ejecutara. Un valor retornado no se convierte en resultado de negocio. | | `failed` | La limpieza lanzó otra excepción; `failure_id` enlaza el fallo de limpieza. | | `expired` | Llegó el límite estricto antes de terminar, incluso si ningún worker pudo ejecutar la limpieza. | -| `preempted` | `cancel()` o `terminate()` inmediato interrumpió la limpieza; el resultado de cancelación/terminación correspondiente sigue siendo terminal. | +| `preempted` | `cancel()` o `terminate()` inmediato, o un plazo estricto anterior al plazo de limpieza, interrumpió la limpieza; el resultado que se adelantó sigue siendo terminal. | + +`completed` no prueba que el código de limpieza se ejecutara, tanto en modo embebido como en modo servicio. La interrupción se entrega en la siguiente espera duradera (actividad, timer, hijo, señal, condición o selección) cuyo resultado aún no estaba en el historial cuando empezó la limpieza, nunca en un efecto secundario ni dentro de `cancellationShield()`. Si la espera en la que está bloqueado el workflow ya se había resuelto, por ejemplo un timer que venció o una actividad que terminó, el código del workflow puede retornar sin recibir la interrupción, y el resultado sigue siendo `completed`. El historial muestra entonces `WorkflowTimeoutCleanupStarted` sin un `CooperativeCancellationDelivered` posterior. Haga idempotente la compensación que siempre debe ejecutarse y ejecútela en todo camino que pueda retornar después del plazo de trabajo, por ejemplo comparando la hora del workflow con el plazo con el que se admitió la ejecución, no solo en el manejador de la interrupción. La limpieza completada, fallida o expirada mantiene el estado de negocio `failed`, `closed_reason = timed_out` y `WorkflowTimedOut`. Compensar correctamente no convierte el timeout en éxito. Si la limpieza termina antes, la ejecución se cierra de inmediato, pero el mensaje de timeout sigue citando la hora del plazo estricto original. -Lea el resultado de la limpieza en el historial. El payload `timeout_cleanup` del evento terminal `WorkflowTimedOut`, `WorkflowTerminated` o `WorkflowCancelled`, incluido también en la salida de `php artisan workflow:v2:history-export`, es el registro autorizado. Desde Workflow 2.40.0, y en Server nativo 3.30.0 y posteriores, describe informa el estado registrado en `run.timeout_cleanup`, y el detalle del run y la observación acotada del run que lee Waterline lo informan como `timeout_cleanup` de nivel superior. Mientras la limpieza está abierta, muestra `outcome: running` con `cause: timeout`, el tipo de timeout, la hora de detección y los plazos de trabajo y de limpieza. Tras el cierre, muestra el resultado terminal, con `failure_id` para `failed`. El campo se omite cuando no se registró ninguna limpieza. +Lea el resultado de la limpieza en el historial. El payload `timeout_cleanup` del evento terminal `WorkflowTimedOut`, `WorkflowTerminated` o `WorkflowCancelled`, incluido también en la salida de `php artisan workflow:v2:history-export`, es el registro autorizado. Desde Workflow 2.40.0, y en Server nativo 3.30.0 y posteriores, describe informa el estado registrado en `run.timeout_cleanup`, y el detalle del run y la observación acotada del run que lee Waterline lo informan como `timeout_cleanup` de nivel superior. Mientras la limpieza está abierta, muestra `outcome: running` con `cause: timeout`, el tipo de timeout, la hora de detección y los plazos de trabajo y de limpieza. Tras el cierre, muestra el resultado terminal, con `failure_id` para `failed`. El campo se omite cuando no se registró ninguna limpieza. Las vistas de lista aún no muestran el estado de la limpieza, así que abra el detalle del run. Los workers ausentes o demorados no garantizan un efecto externo de limpieza; use compensaciones idempotentes y reconcilie los efectos inciertos en su aplicación. diff --git a/i18n/es/source-hashes.json b/i18n/es/source-hashes.json index 0227204f075..ac4f3ad94ef 100644 --- a/i18n/es/source-hashes.json +++ b/i18n/es/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", + "features/sagas.md": "e3727079c1743996d30a157e18c1b668226416cca51956b286aa1bc9e59d0e14", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", + "features/timeouts.md": "69aa0ffe2a913fc7a8a9fd32513d859ef1718281e49cfbdf8c9c8cc7c8c1df98", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/fr/docusaurus-plugin-content-docs/current/features/sagas.md index 3d5279eb205..cc5f066c4d7 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/features/sagas.md @@ -53,7 +53,7 @@ Les activités s’exécutent au moins une fois : un appel d’avancement peut d Avec la politique par défaut d’expiration stricte : Une [expiration du workflow imposée par le moteur](./timeouts.md#timeout-outcome-and-cleanup) ferme le run avant que le code puisse exécuter la compensation. Un bloc `catch` ou `finally` ne change pas ce comportement. Les commandes immédiates `cancel()` et `terminate()` n’offrent pas non plus de fenêtre de nettoyage. -L’[option expérimentale de nettoyage après timeout](./timeouts.md#timeout-cleanup) peut réserver du temps dans le plafond strict original pour un gestionnaire de compensation déclenché par interruption. Elle est expérimentale, sans promesse de rétrocompatibilité pour l’instant. Les workers de file intégrés la prennent en charge à partir de Workflow 2.29.0 (les démarrages intégrés en mode poll la refusent), et le mode service à partir de Server natif 3.30.0 avec des workers SDK compatibles. Elle ne rend pas la compensation automatique et ne garantit pas d’effet sans worker disponible. +L’[option expérimentale de nettoyage après timeout](./timeouts.md#timeout-cleanup) peut réserver du temps dans le plafond strict original pour un gestionnaire de compensation déclenché par interruption. Elle est expérimentale, sans promesse de rétrocompatibilité pour l’instant. Les workers de file intégrés la prennent en charge à partir de Workflow 2.29.0 (les démarrages intégrés en mode poll la refusent), et le mode service à partir de Server natif 3.30.0 avec des workers SDK compatibles. Elle ne rend pas la compensation automatique et ne garantit pas d’effet sans worker disponible, et un résultat de nettoyage `completed` [ne prouve pas que le code de nettoyage a été exécuté](./timeouts.md#timeout-cleanup). Utilisez une échéance applicative plus courte si l’expiration doit annuler du travail déjà effectué. Ce workflow intégré réserve une ressource, puis attend un signal de confirmation pendant au plus 30 secondes. L’expiration reprend le code, qui libère la réservation avant de renvoyer le résultat métier `expired` : diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/fr/docusaurus-plugin-content-docs/current/features/timeouts.md index 04c7471f44e..2a7fffc55e5 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -163,20 +163,22 @@ Chaînez `withTimeoutCleanup()` après `withExecutionTimeout()` ou `withRunTimeo Dans l’exemple, le travail ordinaire dispose de 60 secondes et le nettoyage peut utiliser les 10 dernières dans le plafond strict original de 70 secondes. La réserve n’ajoute jamais de temps après ce plafond. Si les deux échéances strictes s’appliquent, la première borne le nettoyage. Détection tardive, reprises, remplacement de worker et renouvellement de lease ne déplacent aucune échéance. Continue-as-new et redrive conservent la réserve admise et les horloges d’exécution originales ; chaque run dérive ses propres horloges. -Lorsqu’un worker constate l’échéance de travail, le run entre une fois en nettoyage et enregistre `WorkflowTimeoutCleanupStarted`. Si aucun worker ne la constate avant l’échéance stricte, cet événement n’est jamais écrit et le résultat `expired` n’a pas de `started_at`. Le code compatible reçoit `WorkflowTimeoutCleanupRequested`, sous-type de `WorkflowCancellationRequestedException` avec `cause: timeout`. Traitez cette interruption pour exécuter les compensations de saga enregistrées ou le nettoyage protégé ; `compensate()` utilise son bouclier d’annulation. Ce bouclier ne prolonge pas le plafond strict. Voir [Sagas](./sagas.md#deadline-driven-compensation). +Lorsqu’un worker constate l’échéance de travail, le run entre une fois en nettoyage et enregistre `WorkflowTimeoutCleanupStarted`. Si aucun worker ne la constate avant l’échéance stricte, cet événement n’est jamais écrit et le résultat `expired` n’a pas de `started_at`. À sa prochaine attente durable non résolue, le code compatible reçoit `WorkflowTimeoutCleanupRequested`, sous-type de `WorkflowCancellationRequestedException` avec `cause: timeout`. Traitez cette interruption pour exécuter les compensations de saga enregistrées ou le nettoyage protégé ; `compensate()` utilise son bouclier d’annulation. Ce bouclier ne prolonge pas le plafond strict. Voir [Sagas](./sagas.md#deadline-driven-compensation). Le nettoyage a un `timeout_cleanup.outcome` distinct : | Résultat | Signification | |---|---| -| `completed` | Le nettoyage a renvoyé ou relancé l’interruption de timeout avant son échéance. La valeur renvoyée ne devient pas le résultat métier. | +| `completed` | Le code du workflow a renvoyé, ou relancé l’interruption de timeout, avant l’échéance de nettoyage. Cela ne prouve pas que le code de nettoyage a été exécuté. La valeur renvoyée ne devient pas le résultat métier. | | `failed` | Le nettoyage a levé une autre exception ; `failure_id` relie son échec. | | `expired` | Le plafond strict est arrivé avant la fin, y compris lorsqu’aucun worker n’a pu exécuter le nettoyage. | -| `preempted` | Un `cancel()` ou `terminate()` immédiat a interrompu le nettoyage ; le résultat d’annulation/terminaison correspondant reste terminal. | +| `preempted` | Un `cancel()` ou `terminate()` immédiat, ou une échéance stricte antérieure à l’échéance de nettoyage, a interrompu le nettoyage ; le résultat prioritaire reste terminal. | + +`completed` ne prouve pas que le code de nettoyage a été exécuté, en mode intégré comme en mode service. L’interruption est livrée à la prochaine attente durable (activité, timer, enfant, signal, condition ou sélection) dont le résultat n’était pas déjà dans l’historique au début du nettoyage, jamais dans un effet de bord ni à l’intérieur de `cancellationShield()`. Si l’attente sur laquelle le workflow est bloqué était déjà résolue, par exemple un timer déclenché ou une activité terminée, le code du workflow peut renvoyer sans recevoir l’interruption, et le résultat reste `completed`. L’historique montre alors `WorkflowTimeoutCleanupStarted` sans `CooperativeCancellationDelivered` ensuite. Rendez idempotente la compensation qui doit toujours s’exécuter et exécutez-la sur tout chemin qui peut renvoyer après l’échéance de travail, par exemple en comparant l’heure du workflow à l’échéance admise pour le run, et pas seulement dans le gestionnaire d’interruption. Un nettoyage terminé, échoué ou expiré laisse le statut métier `failed`, `closed_reason = timed_out` et `WorkflowTimedOut`. Une compensation réussie ne transforme pas le timeout en succès du workflow. Si le nettoyage se termine plus tôt, le run se ferme aussitôt, mais le message de timeout cite toujours l’heure de l’échéance stricte d’origine. -Lisez le résultat du nettoyage dans l’historique. Le payload `timeout_cleanup` de l’événement terminal `WorkflowTimedOut`, `WorkflowTerminated` ou `WorkflowCancelled`, également présent dans la sortie de `php artisan workflow:v2:history-export`, fait foi. À partir de Workflow 2.40.0, et sur Server natif 3.30.0 ou ultérieur, describe expose l’état enregistré sous `run.timeout_cleanup`, et le détail du run ainsi que l’observation bornée du run lue par Waterline l’exposent comme `timeout_cleanup` de premier niveau. Pendant le nettoyage, il indique `outcome: running` avec `cause: timeout`, le type de timeout, l’heure de détection et les échéances de travail et de nettoyage. Après la clôture, il indique le résultat terminal, avec `failure_id` pour `failed`. Le champ est omis si aucun nettoyage n’a été enregistré. +Lisez le résultat du nettoyage dans l’historique. Le payload `timeout_cleanup` de l’événement terminal `WorkflowTimedOut`, `WorkflowTerminated` ou `WorkflowCancelled`, également présent dans la sortie de `php artisan workflow:v2:history-export`, fait foi. À partir de Workflow 2.40.0, et sur Server natif 3.30.0 ou ultérieur, describe expose l’état enregistré sous `run.timeout_cleanup`, et le détail du run ainsi que l’observation bornée du run lue par Waterline l’exposent comme `timeout_cleanup` de premier niveau. Pendant le nettoyage, il indique `outcome: running` avec `cause: timeout`, le type de timeout, l’heure de détection et les échéances de travail et de nettoyage. Après la clôture, il indique le résultat terminal, avec `failure_id` pour `failed`. Le champ est omis si aucun nettoyage n’a été enregistré. Les vues en liste n’affichent pas encore l’état du nettoyage ; ouvrez donc le détail du run. Des workers absents ou retardés ne garantissent pas l’effet externe du nettoyage ; gardez les compensations idempotentes et réconciliez les effets incertains dans l’application. diff --git a/i18n/fr/source-hashes.json b/i18n/fr/source-hashes.json index 0227204f075..ac4f3ad94ef 100644 --- a/i18n/fr/source-hashes.json +++ b/i18n/fr/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", + "features/sagas.md": "e3727079c1743996d30a157e18c1b668226416cca51956b286aa1bc9e59d0e14", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", + "features/timeouts.md": "69aa0ffe2a913fc7a8a9fd32513d859ef1718281e49cfbdf8c9c8cc7c8c1df98", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/ja/docusaurus-plugin-content-docs/current/features/sagas.md index 4a25263c2a4..e3f424dcc5c 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/features/sagas.md @@ -51,7 +51,7 @@ class BookingSagaWorkflow extends Workflow 既定のハードタイムアウトの方針では、エンジンの[ワークフロータイムアウト](./timeouts.md#timeout-outcome-and-cleanup)は、ワークフローコードが補償を実行する前に実行を閉じます。`catch` や `finally` はこの動作を変えません。即時の `cancel()` と `terminate()` にもクリーンアップ猶予はありません。 -別の[実験的なタイムアウトクリーンアップオプション](./timeouts.md#timeout-cleanup)は、元のハード上限内に、割り込みで起動する補償ハンドラーの時間を予約できます。これは実験的な機能で、後方互換性はまだ約束されていません。embedded queue worker は Workflow 2.29.0 以降でサポートし(embedded の poll mode の開始は拒否します)、service mode は native Server 3.30.0 以降で対応 SDK の worker と組み合わせてサポートします。補償を自動化したり、worker 不在時の効果を保証したりするものではありません。 +別の[実験的なタイムアウトクリーンアップオプション](./timeouts.md#timeout-cleanup)は、元のハード上限内に、割り込みで起動する補償ハンドラーの時間を予約できます。これは実験的な機能で、後方互換性はまだ約束されていません。embedded queue worker は Workflow 2.29.0 以降でサポートし(embedded の poll mode の開始は拒否します)、service mode は native Server 3.30.0 以降で対応 SDK の worker と組み合わせてサポートします。補償を自動化したり、worker 不在時の効果を保証したりするものではなく、クリーンアップ結果 `completed` は[クリーンアップコードが実行されたことを証明しません](./timeouts.md#timeout-cleanup)。 タイムアウト時に完了済み作業を取り消したい場合は、アプリケーション側に早い期限を設けます。この組み込みワークフローはリソースを予約し、確認シグナルを最大 30 秒待ちます。待機が期限切れになるとコードが再開し、予約を解放してから業務結果 `expired` を返します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/ja/docusaurus-plugin-content-docs/current/features/timeouts.md index 766bd79b732..929a63fe101 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -161,20 +161,22 @@ WorkflowStub::make(MyWorkflow::class, 'order-123')->start( この例では通常の作業に 60 秒、クリーンアップに元の 70 秒のハード上限内の最後の 10 秒を使えます。予約は上限後の時間を追加しません。両方のハード期限が適用される場合は、早い方がクリーンアップを制限します。検出の遅れ、再試行、worker 交代、lease 更新で期限は延びません。continue-as-new と redrive は受け付け済みの予約と元の execution の時計を引き継ぎ、各 run は自分の時計を導出します。 -worker が作業期限を検出すると、run は一度だけクリーンアップに入り、`WorkflowTimeoutCleanupStarted` を記録します。ハード期限までにどの worker も検出しなかった場合、このイベントは書き込まれず、`expired` の結果には `started_at` がありません。互換性のあるコードは、`cause: timeout` を持つ `WorkflowCancellationRequestedException` のサブタイプ `WorkflowTimeoutCleanupRequested` を受け取ります。この割り込みを処理して、登録した saga 補償や保護されたクリーンアップを実行してください。`compensate()` は cancellation shield を使いますが、shield はハード上限を延長しません。[Sagas](./sagas.md#deadline-driven-compensation)を参照してください。 +worker が作業期限を検出すると、run は一度だけクリーンアップに入り、`WorkflowTimeoutCleanupStarted` を記録します。ハード期限までにどの worker も検出しなかった場合、このイベントは書き込まれず、`expired` の結果には `started_at` がありません。互換性のあるコードは、次の未解決の永続的な待機で、`cause: timeout` を持つ `WorkflowCancellationRequestedException` のサブタイプ `WorkflowTimeoutCleanupRequested` を受け取ります。この割り込みを処理して、登録した saga 補償や保護されたクリーンアップを実行してください。`compensate()` は cancellation shield を使いますが、shield はハード上限を延長しません。[Sagas](./sagas.md#deadline-driven-compensation)を参照してください。 クリーンアップには独立した `timeout_cleanup.outcome` があります。 | 結果 | 意味 | |---|---| -| `completed` | クリーンアップが期限前に戻ったか、タイムアウト割り込みを再スローしました。戻り値は業務結果になりません。 | +| `completed` | workflow コードがクリーンアップ期限前に戻ったか、タイムアウト割り込みを再スローしました。クリーンアップコードが実行されたことの証明にはなりません。戻り値は業務結果になりません。 | | `failed` | クリーンアップが別の例外を送出し、`failure_id` がクリーンアップの失敗を参照します。 | | `expired` | クリーンアップの完了前にハード上限に達しました。実行できる worker がいなかった場合も含みます。 | -| `preempted` | 即時の `cancel()` または `terminate()` がクリーンアップを中断し、対応するキャンセル/終了の結果が終端となります。 | +| `preempted` | 即時の `cancel()` または `terminate()`、あるいはクリーンアップ期限より前のハード期限がクリーンアップを中断し、優先した結果が終端となります。 | + +embedded mode でも service mode でも、`completed` はクリーンアップコードが実行されたことを証明しません。割り込みは、クリーンアップ開始時点で結果がまだ履歴になかった次の永続的な待機(activity、timer、child、signal、condition、selection)で配信され、side effect や `cancellationShield()` の内部では配信されません。workflow がブロックしている待機がすでに解決済みだった場合(発火済みの timer や完了済みの activity など)、workflow コードは割り込みを受け取らずに return でき、結果はやはり `completed` になります。このとき履歴には `WorkflowTimeoutCleanupStarted` があり、その後に `CooperativeCancellationDelivered` がありません。必ず実行すべき補償は冪等にし、割り込みハンドラーだけでなく、作業期限後に return しうるすべての経路で実行してください。たとえば workflow の時刻を run の受け付け時の期限と比較します。 クリーンアップの完了、失敗、期限切れのいずれでも、業務状態は `failed`、`closed_reason = timed_out`、`WorkflowTimedOut` です。補償が成功しても、タイムアウトが workflow の成功には変わりません。クリーンアップが早く完了すると run はすぐに閉じますが、タイムアウトのメッセージには元のハード期限の時刻が記載されます。 -クリーンアップ結果は履歴で確認してください。終端イベント `WorkflowTimedOut`、`WorkflowTerminated`、`WorkflowCancelled` の `timeout_cleanup` ペイロードが正式な記録で、`php artisan workflow:v2:history-export` の出力にも含まれます。Workflow 2.40.0 以降と native Server 3.30.0 以降では、describe は記録されたクリーンアップ状態を `run.timeout_cleanup` で返し、run detail と Waterline が読む bounded run observation はトップレベルの `timeout_cleanup` で返します。クリーンアップ中は `outcome: running` と `cause: timeout`、タイムアウトの種類、検出時刻、作業期限、クリーンアップ期限を示します。終了後は終端の結果を示し、`failed` の場合は `failure_id` も含みます。クリーンアップが記録されていない場合、このフィールドは省略されます。 +クリーンアップ結果は履歴で確認してください。終端イベント `WorkflowTimedOut`、`WorkflowTerminated`、`WorkflowCancelled` の `timeout_cleanup` ペイロードが正式な記録で、`php artisan workflow:v2:history-export` の出力にも含まれます。Workflow 2.40.0 以降と native Server 3.30.0 以降では、describe は記録されたクリーンアップ状態を `run.timeout_cleanup` で返し、run detail と Waterline が読む bounded run observation はトップレベルの `timeout_cleanup` で返します。クリーンアップ中は `outcome: running` と `cause: timeout`、タイムアウトの種類、検出時刻、作業期限、クリーンアップ期限を示します。終了後は終端の結果を示し、`failed` の場合は `failure_id` も含みます。クリーンアップが記録されていない場合、このフィールドは省略されます。一覧ビューにはまだクリーンアップ状態が表示されないため、run detail を開いてください。 不在または遅延した worker は外部クリーンアップの効果を保証できません。補償を冪等にし、効果が不明な場合はアプリケーションで照合してください。 diff --git a/i18n/ja/source-hashes.json b/i18n/ja/source-hashes.json index 0227204f075..ac4f3ad94ef 100644 --- a/i18n/ja/source-hashes.json +++ b/i18n/ja/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", + "features/sagas.md": "e3727079c1743996d30a157e18c1b668226416cca51956b286aa1bc9e59d0e14", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", + "features/timeouts.md": "69aa0ffe2a913fc7a8a9fd32513d859ef1718281e49cfbdf8c9c8cc7c8c1df98", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/sagas.md index b3faf943120..5c17fa10462 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/sagas.md @@ -53,7 +53,7 @@ Atividades são executadas pelo menos uma vez, então uma chamada de avanço pod Na política padrão de timeout rígido: Um [tempo limite de workflow](./timeouts.md#timeout-outcome-and-cleanup) aplicado pelo motor encerra a execução antes que seu código possa compensar. Um bloco `catch` ou `finally` não muda esse comportamento. Os comandos imediatos `cancel()` e `terminate()` também não dão tempo para a limpeza. -A [opção experimental de limpeza por timeout](./timeouts.md#timeout-cleanup) pode reservar tempo dentro do limite rígido original para um handler de compensação acionado por interrupção. Ela é experimental e ainda não tem promessa de compatibilidade retroativa. Workers de fila embutidos a suportam a partir do Workflow 2.29.0 (inícios embutidos em modo poll a recusam), e o modo de serviço a suporta a partir do Server nativo 3.30.0 com workers de SDK compatíveis. Não torna a compensação automática nem garante efeitos sem workers disponíveis. +A [opção experimental de limpeza por timeout](./timeouts.md#timeout-cleanup) pode reservar tempo dentro do limite rígido original para um handler de compensação acionado por interrupção. Ela é experimental e ainda não tem promessa de compatibilidade retroativa. Workers de fila embutidos a suportam a partir do Workflow 2.29.0 (inícios embutidos em modo poll a recusam), e o modo de serviço a suporta a partir do Server nativo 3.30.0 com workers de SDK compatíveis. Não torna a compensação automática nem garante efeitos sem workers disponíveis, e um resultado de limpeza `completed` [não prova que o código de limpeza foi executado](./timeouts.md#timeout-cleanup). Use um prazo anterior da aplicação quando quiser desfazer o trabalho concluído ao esgotar o tempo. Este workflow incorporado reserva um recurso e espera até 30 segundos por um sinal de confirmação. Ao vencer, o código do workflow retoma, libera a reserva e retorna o resultado de negócio `expired`: diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/timeouts.md index 7c0e8a93e02..456fee1912c 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -163,20 +163,22 @@ Encadeie `withTimeoutCleanup()` depois de `withExecutionTimeout()` ou `withRunTi No exemplo, o trabalho comum recebe 60 segundos e a limpeza pode usar os últimos 10 dentro do limite rígido original de 70 segundos. A reserva nunca adiciona tempo depois desse limite. Se ambos os prazos rígidos se aplicam, o anterior limita a limpeza. Detecção tardia, retries, substituição de worker e renovação de lease não reiniciam prazos. Continue-as-new e redrive preservam a reserva admitida e os relógios de execução originais; cada run deriva os próprios relógios. -Quando um worker observa o prazo de trabalho, o run entra em limpeza uma vez e registra `WorkflowTimeoutCleanupStarted`. Se nenhum worker o observar antes do prazo rígido, esse evento nunca é gravado e o resultado `expired` não tem `started_at`. O código compatível recebe `WorkflowTimeoutCleanupRequested`, subtipo de `WorkflowCancellationRequestedException` com `cause: timeout`. Trate essa interrupção para executar compensações de saga registradas ou limpeza protegida; `compensate()` usa seu escudo de cancelamento. O escudo não estende o limite rígido. Veja [Sagas](./sagas.md#deadline-driven-compensation). +Quando um worker observa o prazo de trabalho, o run entra em limpeza uma vez e registra `WorkflowTimeoutCleanupStarted`. Se nenhum worker o observar antes do prazo rígido, esse evento nunca é gravado e o resultado `expired` não tem `started_at`. Na sua próxima espera durável não resolvida, o código compatível recebe `WorkflowTimeoutCleanupRequested`, subtipo de `WorkflowCancellationRequestedException` com `cause: timeout`. Trate essa interrupção para executar compensações de saga registradas ou limpeza protegida; `compensate()` usa seu escudo de cancelamento. O escudo não estende o limite rígido. Veja [Sagas](./sagas.md#deadline-driven-compensation). A limpeza tem um `timeout_cleanup.outcome` separado: | Resultado | Significado | |---|---| -| `completed` | A limpeza retornou ou relançou a interrupção de timeout antes do prazo. Um valor retornado não se torna o resultado de negócio. | +| `completed` | O código do workflow retornou, ou relançou a interrupção de timeout, antes do prazo de limpeza. Isso não prova que o código de limpeza foi executado. Um valor retornado não se torna o resultado de negócio. | | `failed` | A limpeza lançou outra exceção; `failure_id` vincula a falha da limpeza. | | `expired` | O limite rígido chegou antes de a limpeza terminar, inclusive quando nenhum worker pôde executá-la. | -| `preempted` | `cancel()` ou `terminate()` imediato interrompeu a limpeza; o resultado de cancelamento/terminação correspondente permanece terminal. | +| `preempted` | `cancel()` ou `terminate()` imediato, ou um prazo rígido anterior ao prazo de limpeza, interrompeu a limpeza; o resultado que prevaleceu permanece terminal. | + +`completed` não prova que o código de limpeza foi executado, tanto no modo embutido quanto no modo de serviço. A interrupção é entregue na próxima espera durável (atividade, timer, filho, sinal, condição ou seleção) cujo resultado ainda não estava no histórico quando a limpeza começou, nunca em um efeito colateral nem dentro de `cancellationShield()`. Se a espera em que o workflow está bloqueado já tinha sido resolvida, por exemplo um timer que disparou ou uma atividade que terminou, o código do workflow pode retornar sem receber a interrupção, e o resultado ainda é `completed`. O histórico então mostra `WorkflowTimeoutCleanupStarted` sem um `CooperativeCancellationDelivered` depois dele. Torne idempotente a compensação que sempre precisa ser executada e execute-a em todo caminho que possa retornar após o prazo de trabalho, por exemplo comparando o horário do workflow com o prazo com que o run foi admitido, não apenas no handler da interrupção. Limpeza concluída, falha ou expirada ainda termina com status de negócio `failed`, `closed_reason = timed_out` e `WorkflowTimedOut`. Compensar com sucesso não transforma o timeout em workflow bem-sucedido. Quando a limpeza termina antes, o run fecha imediatamente, mas a mensagem de timeout ainda cita o horário do prazo rígido original. -Leia o resultado da limpeza no histórico. O payload `timeout_cleanup` do evento terminal `WorkflowTimedOut`, `WorkflowTerminated` ou `WorkflowCancelled`, também incluído na saída de `php artisan workflow:v2:history-export`, é o registro oficial. A partir do Workflow 2.40.0, e no Server nativo 3.30.0 ou posterior, describe informa o estado registrado em `run.timeout_cleanup`, e o detalhe do run e a observação limitada do run que o Waterline lê o informam como `timeout_cleanup` de nível superior. Enquanto a limpeza está aberta, ele mostra `outcome: running` com `cause: timeout`, o tipo de timeout, o horário da detecção e os prazos de trabalho e de limpeza. Após o encerramento, mostra o resultado terminal, com `failure_id` para `failed`. O campo é omitido quando nenhuma limpeza foi registrada. +Leia o resultado da limpeza no histórico. O payload `timeout_cleanup` do evento terminal `WorkflowTimedOut`, `WorkflowTerminated` ou `WorkflowCancelled`, também incluído na saída de `php artisan workflow:v2:history-export`, é o registro oficial. A partir do Workflow 2.40.0, e no Server nativo 3.30.0 ou posterior, describe informa o estado registrado em `run.timeout_cleanup`, e o detalhe do run e a observação limitada do run que o Waterline lê o informam como `timeout_cleanup` de nível superior. Enquanto a limpeza está aberta, ele mostra `outcome: running` com `cause: timeout`, o tipo de timeout, o horário da detecção e os prazos de trabalho e de limpeza. Após o encerramento, mostra o resultado terminal, com `failure_id` para `failed`. O campo é omitido quando nenhuma limpeza foi registrada. As visualizações de lista ainda não mostram o estado da limpeza, então abra o detalhe do run. Workers indisponíveis ou atrasados não garantem um efeito externo de limpeza; mantenha compensações idempotentes e reconcilie efeitos incertos na aplicação. diff --git a/i18n/pt-BR/source-hashes.json b/i18n/pt-BR/source-hashes.json index 0227204f075..ac4f3ad94ef 100644 --- a/i18n/pt-BR/source-hashes.json +++ b/i18n/pt-BR/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", + "features/sagas.md": "e3727079c1743996d30a157e18c1b668226416cca51956b286aa1bc9e59d0e14", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", + "features/timeouts.md": "69aa0ffe2a913fc7a8a9fd32513d859ef1718281e49cfbdf8c9c8cc7c8c1df98", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/uk/docusaurus-plugin-content-docs/current/features/sagas.md index fb9b532fc34..dceb7fa20cc 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/features/sagas.md @@ -58,7 +58,7 @@ Activity виконуються щонайменше один раз, тому або `finally` цього не змінює. Негайні команди `cancel()` і `terminate()` також не надають вікна для очищення. -Окрема [експериментальна опція очищення за тайм-аутом](./timeouts.md#timeout-cleanup) може зарезервувати час усередині початкової жорсткої межі для обробника компенсації, викликаного перериванням. Вона експериментальна і поки без гарантії зворотної сумісності. Вбудовані воркери черги підтримують її з Workflow 2.29.0 (вбудовані запуски в режимі poll її відхиляють), а режим сервісу — з нативного Server 3.30.0 із сумісними воркерами SDK. Компенсація не стає автоматичною і без доступних воркерів ефект не гарантується. +Окрема [експериментальна опція очищення за тайм-аутом](./timeouts.md#timeout-cleanup) може зарезервувати час усередині початкової жорсткої межі для обробника компенсації, викликаного перериванням. Вона експериментальна і поки без гарантії зворотної сумісності. Вбудовані воркери черги підтримують її з Workflow 2.29.0 (вбудовані запуски в режимі poll її відхиляють), а режим сервісу — з нативного Server 3.30.0 із сумісними воркерами SDK. Компенсація не стає автоматичною і без доступних воркерів ефект не гарантується, а результат очищення `completed` [не доводить, що код очищення виконався](./timeouts.md#timeout-cleanup). Якщо сплив часу має скасувати вже виконану роботу, задайте раніший прикладний термін. Цей вбудований workflow резервує ресурс і до 30 секунд чекає на signal diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/uk/docusaurus-plugin-content-docs/current/features/timeouts.md index bcf5158e3e2..60e5f17a00c 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -180,20 +180,22 @@ WorkflowStub::make(MyWorkflow::class, 'order-123')->start( У прикладі звичайна робота має 60 секунд, а очищення може використати останні 10 усередині початкової жорсткої межі 70 секунд. Резерв ніколи не додає часу після цієї межі. Якщо діють обидва жорсткі терміни, очищення обмежує раніший. Пізнє виявлення, повтори, заміна воркера та поновлення lease не пересувають терміни. Continue-as-new і redrive зберігають прийнятий резерв та початкові годинники виконання; кожний запуск виводить власні годинники. -Коли воркер помічає робочий термін, запуск один раз переходить до очищення та записує `WorkflowTimeoutCleanupStarted`. Якщо жоден воркер не помітить його до жорсткого терміну, ця подія не записується, а результат `expired` не має `started_at`. Сумісний код отримує `WorkflowTimeoutCleanupRequested`, підтип `WorkflowCancellationRequestedException` із `cause: timeout`. Обробіть переривання для зареєстрованих компенсацій saga чи захищеного очищення; `compensate()` використовує свій щит скасування. Щит не подовжує жорстку межу. Дивіться [Sagas](./sagas.md#deadline-driven-compensation). +Коли воркер помічає робочий термін, запуск один раз переходить до очищення та записує `WorkflowTimeoutCleanupStarted`. Якщо жоден воркер не помітить його до жорсткого терміну, ця подія не записується, а результат `expired` не має `started_at`. На наступному нерозв’язаному довговічному очікуванні сумісний код отримує `WorkflowTimeoutCleanupRequested`, підтип `WorkflowCancellationRequestedException` із `cause: timeout`. Обробіть переривання для зареєстрованих компенсацій saga чи захищеного очищення; `compensate()` використовує свій щит скасування. Щит не подовжує жорстку межу. Дивіться [Sagas](./sagas.md#deadline-driven-compensation). Очищення має окремий `timeout_cleanup.outcome`: | Результат | Значення | |---|---| -| `completed` | Очищення повернулося або повторно кинуло переривання тайм-ауту до свого терміну. Повернене значення не стає бізнес-результатом. | +| `completed` | Код workflow повернувся або повторно кинув переривання тайм-ауту до кінцевого терміну очищення. Це не доводить, що код очищення виконався. Повернене значення не стає бізнес-результатом. | | `failed` | Очищення кинуло інший виняток; `failure_id` посилається на збій очищення. | | `expired` | Жорстка межа настала до завершення, зокрема якщо жоден воркер не міг виконати очищення. | -| `preempted` | Негайний `cancel()` або `terminate()` перервав очищення; відповідний результат скасування/припинення залишається термінальним. | +| `preempted` | Негайний `cancel()` або `terminate()` чи жорсткий термін, раніший за кінцевий термін очищення, перервав очищення; результат, що випередив його, залишається термінальним. | + +`completed` не доводить, що код очищення виконався, як у вбудованому режимі, так і в режимі сервісу. Переривання доставляється на наступному довговічному очікуванні (активність, таймер, дочірній workflow, сигнал, умова або вибір), результату якого ще не було в історії, коли почалося очищення, і ніколи — у side effect чи всередині `cancellationShield()`. Якщо очікування, на якому заблокований workflow, уже було розв’язане, наприклад таймер спрацював або активність завершилася, код workflow може повернутися, не отримавши переривання, і результат усе одно буде `completed`. Тоді історія показує `WorkflowTimeoutCleanupStarted` без подальшого `CooperativeCancellationDelivered`. Робіть компенсацію, яка має виконуватися завжди, ідемпотентною і запускайте її на кожному шляху, що може повернутися після робочого терміну, наприклад порівнюючи час workflow з терміном, з яким запуск було допущено, а не лише в обробнику переривання. Завершене, невдале чи прострочене очищення все одно має бізнес-статус `failed`, `closed_reason = timed_out` і `WorkflowTimedOut`. Успішна компенсація не перетворює тайм-аут на успішний workflow. Якщо очищення завершується раніше, запуск закривається одразу, але повідомлення про тайм-аут усе одно вказує час початкового жорсткого терміну. -Читайте результат очищення з історії. Payload `timeout_cleanup` у термінальній події `WorkflowTimedOut`, `WorkflowTerminated` або `WorkflowCancelled`, який також є у виводі `php artisan workflow:v2:history-export`, є авторитетним записом. Починаючи з Workflow 2.40.0, а також у нативному Server 3.30.0 і новіших, describe повідомляє записаний стан у `run.timeout_cleanup`, а деталі запуску та обмежене спостереження запуску, яке читає Waterline, повідомляють його як `timeout_cleanup` верхнього рівня. Поки очищення відкрите, поле показує `outcome: running` з `cause: timeout`, вид тайм-ауту, час виявлення та робочий і кінцевий терміни очищення. Після закриття воно показує термінальний результат, для `failed` — з `failure_id`. Якщо очищення не записано, поле відсутнє. +Читайте результат очищення з історії. Payload `timeout_cleanup` у термінальній події `WorkflowTimedOut`, `WorkflowTerminated` або `WorkflowCancelled`, який також є у виводі `php artisan workflow:v2:history-export`, є авторитетним записом. Починаючи з Workflow 2.40.0, а також у нативному Server 3.30.0 і новіших, describe повідомляє записаний стан у `run.timeout_cleanup`, а деталі запуску та обмежене спостереження запуску, яке читає Waterline, повідомляють його як `timeout_cleanup` верхнього рівня. Поки очищення відкрите, поле показує `outcome: running` з `cause: timeout`, вид тайм-ауту, час виявлення та робочий і кінцевий терміни очищення. Після закриття воно показує термінальний результат, для `failed` — з `failure_id`. Якщо очищення не записано, поле відсутнє. Спискові подання поки не показують стан очищення, тож відкривайте деталі запуску. Недоступні чи затримані воркери не гарантують зовнішнього ефекту очищення; робіть компенсації ідемпотентними та звіряйте невизначені ефекти в застосунку. diff --git a/i18n/uk/source-hashes.json b/i18n/uk/source-hashes.json index 0227204f075..ac4f3ad94ef 100644 --- a/i18n/uk/source-hashes.json +++ b/i18n/uk/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", + "features/sagas.md": "e3727079c1743996d30a157e18c1b668226416cca51956b286aa1bc9e59d0e14", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", + "features/timeouts.md": "69aa0ffe2a913fc7a8a9fd32513d859ef1718281e49cfbdf8c9c8cc7c8c1df98", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e", diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/sagas.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/sagas.md index becc427a8ef..c8d6fe8a1e4 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/sagas.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/sagas.md @@ -51,7 +51,7 @@ class BookingSagaWorkflow extends Workflow 默认硬超时策略下,引擎[工作流超时](./timeouts.md#timeout-outcome-and-cleanup)会在工作流代码运行补偿前关闭运行。`catch` 或 `finally` 不会改变该行为。立即执行的 `cancel()` 与 `terminate()` 也不提供清理窗口。 -独立的[实验性超时清理选项](./timeouts.md#timeout-cleanup)可在原始硬上限内为中断驱动的补偿处理器预留时间。它是实验性功能,目前不承诺向后兼容。嵌入式队列 worker 从 Workflow 2.29.0 起支持它(嵌入式 poll 模式启动会拒绝它),service 模式从原生 Server 3.30.0 起在有受支持的 SDK worker 时支持它。它不会使补偿自动发生,也不会在 worker 不可用时保证外部效果。 +独立的[实验性超时清理选项](./timeouts.md#timeout-cleanup)可在原始硬上限内为中断驱动的补偿处理器预留时间。它是实验性功能,目前不承诺向后兼容。嵌入式队列 worker 从 Workflow 2.29.0 起支持它(嵌入式 poll 模式启动会拒绝它),service 模式从原生 Server 3.30.0 起在有受支持的 SDK worker 时支持它。它不会使补偿自动发生,也不会在 worker 不可用时保证外部效果,而且清理结果 `completed` [不能证明清理代码已运行](./timeouts.md#timeout-cleanup)。 如果超时应撤销已完成工作,请使用更早的应用截止时间。此嵌入式工作流先预订资源,再最多等待确认信号 30 秒。等待到期后,工作流代码恢复,释放预订,然后返回 `expired` 业务结果: diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/timeouts.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/timeouts.md index adddd5a029a..941f07dfcc8 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/timeouts.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features/timeouts.md @@ -161,20 +161,22 @@ WorkflowStub::make(MyWorkflow::class, 'order-123')->start( 本例为普通工作提供 60 秒,清理可使用原始 70 秒硬上限内的最后 10 秒。预留绝不在硬上限后增加时间。若两个硬截止时间都适用,较早的一个限制清理。延迟检测、重试、worker 替换和 lease 续期都不重置任何截止时间。continue-as-new 和 redrive 保留已接纳的预留及原始 execution 时钟;每个 run 推导自己的时钟。 -worker 发现已到工作截止时间后,运行只进入一次清理并记录 `WorkflowTimeoutCleanupStarted`。如果在硬截止时间前没有 worker 发现,则不会写入该事件,`expired` 结果也没有 `started_at`。兼容代码收到 `WorkflowTimeoutCleanupRequested`,它是 `WorkflowCancellationRequestedException` 的子类型,取消上下文包含 `cause: timeout`。处理此中断以执行已注册的 saga 补偿或受保护清理;`compensate()` 使用其取消屏蔽,但屏蔽不延长硬上限。参阅 [Sagas](./sagas.md#deadline-driven-compensation)。 +worker 发现已到工作截止时间后,运行只进入一次清理并记录 `WorkflowTimeoutCleanupStarted`。如果在硬截止时间前没有 worker 发现,则不会写入该事件,`expired` 结果也没有 `started_at`。兼容代码会在下一个未解决的持久等待处收到 `WorkflowTimeoutCleanupRequested`,它是 `WorkflowCancellationRequestedException` 的子类型,取消上下文包含 `cause: timeout`。处理此中断以执行已注册的 saga 补偿或受保护清理;`compensate()` 使用其取消屏蔽,但屏蔽不延长硬上限。参阅 [Sagas](./sagas.md#deadline-driven-compensation)。 清理具有独立的 `timeout_cleanup.outcome`: | 结果 | 含义 | |---|---| -| `completed` | 清理在截止时间前返回或重新抛出超时中断。返回值不会成为业务结果。 | +| `completed` | 工作流代码在清理截止时间前返回,或重新抛出超时中断。这不能证明清理代码已运行。返回值不会成为业务结果。 | | `failed` | 清理抛出其他异常;`failure_id` 链接清理失败。 | | `expired` | 硬上限先于清理完成到达,包括没有 worker 能运行清理的情况。 | -| `preempted` | 立即 `cancel()` 或 `terminate()` 中断清理;对应的取消/终止结果仍为终态。 | +| `preempted` | 立即 `cancel()` 或 `terminate()`,或早于清理截止时间的硬截止时间中断了清理;抢先发生的结果仍为终态。 | + +无论嵌入式模式还是 service 模式,`completed` 都不能证明清理代码已运行。中断会在下一个持久等待(activity、timer、child、signal、condition 或 selection)处投递,前提是该等待的结果在清理开始时尚未写入历史;它绝不会在 side effect 中或 `cancellationShield()` 内投递。如果工作流正在阻塞的等待已经解决,例如 timer 已触发或 activity 已完成,工作流代码可能未收到中断就返回,结果仍为 `completed`。此时历史中有 `WorkflowTimeoutCleanupStarted`,其后没有 `CooperativeCancellationDelivered`。必须始终运行的补偿应保持幂等,并在工作截止时间之后可能返回的每条路径上运行,而不只是在中断处理器中运行,例如将工作流时间与运行接纳时的截止时间进行比较。 清理完成、失败或过期后,业务状态仍是 `failed`、`closed_reason = timed_out` 和 `WorkflowTimedOut`。补偿成功不会把超时变为 workflow 成功。清理提前完成时,运行会立即关闭,但超时消息仍引用原始硬截止时间。 -请从历史读取清理结果。终止事件 `WorkflowTimedOut`、`WorkflowTerminated` 或 `WorkflowCancelled` 上的 `timeout_cleanup` 载荷是权威记录,也包含在 `php artisan workflow:v2:history-export` 的输出中。从 Workflow 2.40.0 起,以及在原生 Server 3.30.0 及更高版本上,describe 在 `run.timeout_cleanup` 下报告已记录的清理状态,run detail 和 Waterline 读取的有界运行观察则以顶层 `timeout_cleanup` 报告。清理进行中时,它显示 `outcome: running`、`cause: timeout`、超时类型、检测时间以及工作截止时间和清理截止时间。关闭后,它显示终态结果,`failed` 时附带 `failure_id`。未记录清理时省略该字段。 +请从历史读取清理结果。终止事件 `WorkflowTimedOut`、`WorkflowTerminated` 或 `WorkflowCancelled` 上的 `timeout_cleanup` 载荷是权威记录,也包含在 `php artisan workflow:v2:history-export` 的输出中。从 Workflow 2.40.0 起,以及在原生 Server 3.30.0 及更高版本上,describe 在 `run.timeout_cleanup` 下报告已记录的清理状态,run detail 和 Waterline 读取的有界运行观察则以顶层 `timeout_cleanup` 报告。清理进行中时,它显示 `outcome: running`、`cause: timeout`、超时类型、检测时间以及工作截止时间和清理截止时间。关闭后,它显示终态结果,`failed` 时附带 `failure_id`。未记录清理时省略该字段。列表视图尚不显示清理状态,请打开 run detail 查看。 不可用或延迟的 worker 无法保证外部清理效果;补偿必须幂等,并由应用核对不确定的效果。 diff --git a/i18n/zh-Hans/source-hashes.json b/i18n/zh-Hans/source-hashes.json index 0227204f075..ac4f3ad94ef 100644 --- a/i18n/zh-Hans/source-hashes.json +++ b/i18n/zh-Hans/source-hashes.json @@ -44,7 +44,7 @@ "features/memo.md": "e1bb34216febf112c0d9151b8a57e31cc2de17b4bf16980812da01c0e1c17f15", "features/message-streams.md": "8a21b2e6dff51c69a3395d50ea6167e418ed793b4b7107b964f2a0f5f03a3801", "features/queries.md": "c66dd9542a062edd8158a46cebc9f1bf926aaf3599dca4a3122bd9860df6e2a2", - "features/sagas.md": "3e82a292ed019458536b3089790fb18616e3e97cdb9f86e865f2dbd77708e8ab", + "features/sagas.md": "e3727079c1743996d30a157e18c1b668226416cca51956b286aa1bc9e59d0e14", "features/compensation-scopes.md": "339597d3f95067ea4c6ed4f9f606fa108374df12d5e1466b148087f9e1291cea", "features/schedules.md": "be2c3713795932261f8d22a42ccb9a6647c8cfb5b19f998d6f55079666f12437", "features/search-attributes.md": "034ce80ef59a1ba460e41ebf7d7e2d72cfa272bdce609ef5a696c7c8877aeaa5", @@ -53,7 +53,7 @@ "features/signal+timer.md": "194d89cf97b904527f0a77fb8d0bd5b0a8b6e348df8be42aa466834afa5c2b85", "features/signals.md": "d79518932e35625adfecd0d0e76b936ba802d13aef1c887ff4a33edcab97f75b", "features/sticky-execution.md": "d54fe85283d633d5cba10a03c716a707bf3b6a4e6d47ec9859e17f5f676a89b8", - "features/timeouts.md": "3ff5796bba9c039c561b9e24ae30d4440dc9b1b6887d3a9e62d0659be930aaea", + "features/timeouts.md": "69aa0ffe2a913fc7a8a9fd32513d859ef1718281e49cfbdf8c9c8cc7c8c1df98", "features/timers.md": "8ef45889325eb3358dd7c894511dfbd647e2813fd2eb368069f17d56c90a5d27", "features/updates.md": "37866ab321b74be259604d4b451fdec97df808c6036f5fcf550ad106142ae981", "features/versioning.md": "7f9d97fab5811167c00fcb8b0be76bcb6bc402cbb5949a770878e098d0a7785e",