From 90ced51475af5707711fb7337683982382de7535 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sat, 14 Nov 2026 16:13:27 +0000 Subject: [PATCH 1/2] Explain recorded retry backoff and repeat-last behavior --- docs/configuration/options.md | 8 ++++++-- docs/polyglot/worker-protocol.md | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/configuration/options.md b/docs/configuration/options.md index 5cf6b38b504..9e54a218be5 100644 --- a/docs/configuration/options.md +++ b/docs/configuration/options.md @@ -93,7 +93,7 @@ Routing overrides in `ActivityOptions` apply when a new activity execution is sc Retry and timeout fields override the activity class for this call only: - `maxAttempts`: total attempts, counting the first one. It must be at least 1. A new activity scheduled with 0 or less fails the run. Omit it to use the class `$tries`, where `0` retries forever. -- `backoff`: seconds to wait before each retry, as a list or a single value. It overrides the class `backoff()`. +- `backoff`: seconds to wait before each retry, as a list or a single value. It overrides the class `backoff()`. When the list runs out, repeat its final entry. An empty list adds no delay. See [Backoff](#backoff). - `nonRetryableErrorTypes`: error type or class names that fail the activity without another attempt. - `startToCloseTimeout`: maximum seconds for one attempt. - `scheduleToStartTimeout`: maximum seconds an activity may wait for a worker before it starts. @@ -122,7 +122,11 @@ The v2 `Activity` base class has no `$timeout` class property. Configure activit ## Backoff -The `backoff` method returns an array of integers corresponding to the current attempt. The default `backoff` method decays exponentially to 2 minutes. This can be overridden by implementing the `backoff` method on the activity class. +The `backoff()` method returns retry delays in seconds as an integer or a list. The default list reaches 120 seconds (2 minutes). Override it by implementing `backoff()` on the activity class. + +When retries outnumber the list entries, the final delay repeats. For `maxAttempts: 5` and `backoff: [1, 2]`, the four retry delays are `[1, 2, 2, 2]` seconds. An empty list, `backoff: []`, requests immediate retries (zero backoff), subject to the attempt and timeout limits. + +The retry policy is recorded when the activity is scheduled. Already recorded policies keep their recorded delays when later code changes the class defaults or options. ## Namespace diff --git a/docs/polyglot/worker-protocol.md b/docs/polyglot/worker-protocol.md index c913b72c33c..dc4f5561bc2 100644 --- a/docs/polyglot/worker-protocol.md +++ b/docs/polyglot/worker-protocol.md @@ -296,6 +296,16 @@ When completing a workflow task, the external worker submits a list of typed com `heartbeat_timeout` fields. `retry_policy` uses `max_attempts`, `backoff_seconds`, and `non_retryable_error_types`. +`max_attempts` counts total attempts, including the first one. When +`backoff_seconds` runs out, repeat its final entry. For `max_attempts: 5` +and `backoff_seconds: [1, 2]`, the four retry delays are `[1, 2, 2, 2]` +seconds. An empty list, `backoff_seconds: []`, requests immediate retries +(zero backoff), subject to the attempt and timeout limits. + +The policy is recorded when the activity is scheduled. Keep its recorded +delays for that activity, including replay under a later SDK. Do not +recompute them from newer defaults. + `start_child_workflow` accepts optional `parent_close_policy`, `retry_policy`, `execution_timeout_seconds`, and `run_timeout_seconds` fields. `parent_close_policy` is one of `abandon`, `request_cancel`, From 4aba847e4b9e6f7c2a4f8ff2e38f667ccf679d23 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sat, 14 Nov 2026 16:15:20 +0000 Subject: [PATCH 2/2] Translate retry-delay rule and recorded-policy guidance --- .../current/configuration/options.md | 11 ++++++----- .../current/polyglot/worker-protocol.md | 4 ++++ i18n/de/source-hashes.json | 4 ++-- .../current/configuration/options.md | 8 ++++++-- .../current/polyglot/worker-protocol.md | 4 ++++ i18n/es/source-hashes.json | 4 ++-- .../current/configuration/options.md | 8 ++++++-- .../current/polyglot/worker-protocol.md | 4 ++++ i18n/fr/source-hashes.json | 4 ++-- .../current/configuration/options.md | 8 ++++++-- .../current/polyglot/worker-protocol.md | 4 ++++ i18n/ja/source-hashes.json | 4 ++-- .../current/configuration/options.md | 8 ++++++-- .../current/polyglot/worker-protocol.md | 4 ++++ i18n/pt-BR/source-hashes.json | 4 ++-- .../current/configuration/options.md | 8 ++++++-- .../current/polyglot/worker-protocol.md | 4 ++++ i18n/uk/source-hashes.json | 4 ++-- .../current/configuration/options.md | 8 ++++++-- .../current/polyglot/worker-protocol.md | 4 ++++ i18n/zh-Hans/source-hashes.json | 4 ++-- 21 files changed, 84 insertions(+), 31 deletions(-) diff --git a/i18n/de/docusaurus-plugin-content-docs/current/configuration/options.md b/i18n/de/docusaurus-plugin-content-docs/current/configuration/options.md index bdd555a4ed4..d5770be726e 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/configuration/options.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/configuration/options.md @@ -113,7 +113,7 @@ Routing-Überschreibungen in `ActivityOptions` gelten beim Planen einer neuen Ak Wiederholungs- und Timeout-Felder überschreiben die Aktivitätsklasse nur für diesen Aufruf: - `maxAttempts`: Gesamtzahl der Versuche, einschließlich des ersten. Der Wert muss mindestens 1 sein. Eine neue Aktivität, die mit 0 oder weniger geplant wird, lässt den Lauf fehlschlagen. Lassen Sie das Feld weg, um `$tries` der Klasse zu verwenden, wobei `0` unbegrenzt wiederholt. -- `backoff`: Sekunden Wartezeit vor jeder Wiederholung, als Liste oder Einzelwert. Überschreibt `backoff()` der Klasse. +- `backoff`: Sekunden Wartezeit vor jeder Wiederholung, als Liste oder Einzelwert. Überschreibt `backoff()` der Klasse. Ist die Liste ausgeschöpft, wird ihr letzter Eintrag wiederholt. Eine leere Liste fügt keine Verzögerung hinzu. Siehe [Wartezeiten zwischen Versuchen](#backoff). - `nonRetryableErrorTypes`: Fehlertyp- oder Klassennamen, die die Aktivität ohne weiteren Versuch fehlschlagen lassen. - `startToCloseTimeout`: maximale Sekunden für einen Versuch. - `scheduleToStartTimeout`: maximale Sekunden, die eine Aktivität vor dem Start auf einen Worker warten darf. @@ -163,10 +163,11 @@ gesteuert. ## Wartezeiten zwischen Versuchen {#backoff} -Die Methode `backoff` gibt ein Array von Ganzzahlen für den jeweiligen Versuch -zurück. Die Standardmethode `backoff` verwendet exponentiell anwachsende -Wartezeiten bis zu 2 Minuten. Sie können dies durch Implementieren der Methode -`backoff` in der Aktivitätsklasse überschreiben. +Die Methode `backoff()` liefert Wiederholungsverzögerungen in Sekunden als Ganzzahl oder Liste. Die Standardliste erreicht 120 Sekunden (2 Minuten). Überschreiben Sie sie durch eine eigene `backoff()`-Methode in der Aktivitätsklasse. + +Gibt es mehr Wiederholungen als Listeneinträge, wird die letzte Verzögerung wiederholt. Bei `maxAttempts: 5` und `backoff: [1, 2]` lauten die vier Wiederholungsverzögerungen `[1, 2, 2, 2]` Sekunden. Eine leere Liste, `backoff: []`, fordert sofortige Wiederholungen ohne Backoff an, unter Einhaltung der Versuchs- und Zeitlimits. + +Die Wiederholungsrichtlinie wird beim Planen der Aktivität aufgezeichnet. Bereits aufgezeichnete Richtlinien behalten ihre Verzögerungen, wenn späterer Code die Klassenstandards oder Optionen ändert. ## Namespace {#namespace} diff --git a/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md b/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md index 1905c084f7c..ae67d9c1cf8 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md @@ -302,6 +302,10 @@ Beim Workflow-Task-Abschluss übermittelt der externe Worker eine Liste typisier `schedule_to_start_timeout`, `schedule_to_close_timeout` und `heartbeat_timeout`. `retry_policy` verwendet `max_attempts`, `backoff_seconds` und `non_retryable_error_types`. +`max_attempts` zählt alle Versuche einschließlich des ersten. Ist `backoff_seconds` ausgeschöpft, wird sein letzter Eintrag wiederholt. Bei `max_attempts: 5` und `backoff_seconds: [1, 2]` lauten die vier Wiederholungsverzögerungen `[1, 2, 2, 2]` Sekunden. Eine leere Liste, `backoff_seconds: []`, fordert sofortige Wiederholungen ohne Backoff an, unter Einhaltung der Versuchs- und Zeitlimits. + +Die Richtlinie wird beim Planen der Aktivität aufgezeichnet. Behalten Sie deren aufgezeichnete Verzögerungen für diese Aktivität bei, auch beim Replay mit einem späteren SDK. Berechnen Sie sie nicht anhand neuer Standardwerte neu. + `start_child_workflow` akzeptiert optional `parent_close_policy`, `retry_policy`, `execution_timeout_seconds` und `run_timeout_seconds`. `parent_close_policy` ist `abandon`, `request_cancel`, `request_cancellation` oder `terminate`. diff --git a/i18n/de/source-hashes.json b/i18n/de/source-hashes.json index 27457e918dd..243a665dfb3 100644 --- a/i18n/de/source-hashes.json +++ b/i18n/de/source-hashes.json @@ -9,7 +9,7 @@ "configuration/database-connection.md": "cc83ae77133236309506fa44d39bfd0c939c32a6154c0bd6099bc64c83bdaec9", "configuration/ensuring-same-server.md": "6c665f37cc198c7b1a775a60a94aab5ff4e55383385e76f1834c7840559b512a", "configuration/microservices.md": "46dc4afa07588b78829a7e3d259177ce0cf40861f0e31b88dbb6de3a83aa5488", - "configuration/options.md": "42c40c50ecdf9fc6eace79d212229dfe0dac119c23137225f0ce353952fbd549", + "configuration/options.md": "68478650212fc5a5ddc88da577772b0131b8fe5f931ae8fd19fcb78bdb95ffeb", "configuration/pruning-workflows.md": "6f6ee2be3bd185ffec764e86c3ed3cbd40c45f75d28671b4cd11226493e11afb", "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", @@ -98,7 +98,7 @@ "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", "polyglot/worker-build-id-rollout.md": "62ddf1ca054cf4b83de2fa020f313a153ece00519f804c4f8f30aca53c979af0", "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", - "polyglot/worker-protocol.md": "007e844b0a7ab284b7cd343e79f01a27a0dabee3fe4cf19064170581bb897b85", + "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", "quickstart.md": "887c6b500e17d41e6098f97f62e07ab3f2a05cd94e36aed93bf05fcce7b532e2", "rolling-upgrades.md": "6acff017f2148d4f7553ebd4811aff8bde59cf6da4251845f4240ef7d1b1a970", diff --git a/i18n/es/docusaurus-plugin-content-docs/current/configuration/options.md b/i18n/es/docusaurus-plugin-content-docs/current/configuration/options.md index df078aa624c..3fda445603d 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/configuration/options.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/configuration/options.md @@ -93,7 +93,7 @@ Las opciones de enrutamiento de `ActivityOptions` se aplican al programar una nu Los campos de reintento y tiempo límite sustituyen a la clase de la actividad solo en esta llamada: - `maxAttempts`: número total de intentos, incluido el primero. Debe ser al menos 1. Una actividad nueva programada con 0 o menos hace fallar la ejecución. Omítelo para usar `$tries` de la clase, donde `0` reintenta indefinidamente. -- `backoff`: segundos de espera antes de cada reintento, como lista o como un único valor. Sustituye a `backoff()` de la clase. +- `backoff`: segundos de espera antes de cada reintento, como lista o como un único valor. Sustituye a `backoff()` de la clase. Al agotarse la lista, se repite su última entrada. Una lista vacía no añade demora. Consulte [Espera entre reintentos](#backoff). - `nonRetryableErrorTypes`: nombres de tipos o clases de error que hacen fallar la actividad sin otro intento. - `startToCloseTimeout`: segundos máximos para un intento. - `scheduleToStartTimeout`: segundos máximos que una actividad puede esperar a un worker antes de empezar. @@ -122,7 +122,11 @@ La clase base `Activity` v2 no tiene una propiedad `$timeout`. Configura los tie ## Espera entre reintentos {#backoff} -El método `backoff` devuelve un array de enteros que corresponden al intento actual. La espera predeterminada crece exponencialmente hasta 2 minutos. Puedes cambiarla implementando `backoff` en la clase de actividad. +El método `backoff()` devuelve las demoras de reintento en segundos como entero o lista. La lista predeterminada llega a 120 segundos (2 minutos). Sustitúyala implementando `backoff()` en la clase de actividad. + +Cuando hay más reintentos que entradas, se repite la última demora. Con `maxAttempts: 5` y `backoff: [1, 2]`, las cuatro demoras de reintento son `[1, 2, 2, 2]` segundos. Una lista vacía, `backoff: []`, solicita reintentos inmediatos sin espera, sujetos a los límites de intentos y tiempo. + +La política de reintentos se registra al programar la actividad. Las políticas ya registradas conservan sus demoras cuando código posterior cambia los valores predeterminados de la clase o las opciones. ## Espacio de nombres {#namespace} diff --git a/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md b/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md index f654b215869..0423b5995a5 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md @@ -249,6 +249,10 @@ Al completar una tarea, el worker externo envía una lista de comandos tipados. `schedule_activity` acepta campos opcionales `retry_policy`, `start_to_close_timeout`, `schedule_to_start_timeout`, `schedule_to_close_timeout` y `heartbeat_timeout`. `retry_policy` utiliza `max_attempts`, `backoff_seconds` y `non_retryable_error_types`. +`max_attempts` cuenta los intentos totales, incluido el primero. Al agotarse `backoff_seconds`, se repite su última entrada. Con `max_attempts: 5` y `backoff_seconds: [1, 2]`, las cuatro demoras de reintento son `[1, 2, 2, 2]` segundos. Una lista vacía, `backoff_seconds: []`, solicita reintentos inmediatos sin espera, sujetos a los límites de intentos y tiempo. + +La política se registra al programar la actividad. Conserve sus demoras registradas para esa actividad, incluso al reproducirla con un SDK posterior. No las recalcule a partir de valores predeterminados nuevos. + `start_child_workflow` acepta `parent_close_policy`, `retry_policy`, `execution_timeout_seconds` y `run_timeout_seconds` opcionales. `parent_close_policy` es `abandon`, `request_cancel`, `request_cancellation` o `terminate`. `request_cancel` cierra al hijo inmediatamente; `request_cancellation` solicita limpieza cooperativa con identidad y plazo de cancelación originales. Consulta [cancelación cooperativa](/docs/polyglot/cancellation). Los reintentos del hijo utilizan la misma estructura `max_attempts`, `backoff_seconds` y `non_retryable_error_types` que las actividades. La espera se aplica tras fallar una ejecución hija; comandos de inicio no válidos son errores de protocolo y no consumen intentos de reintento del hijo. `complete_update` cierra la actualización aceptada identificada por `update_id` tras aplicar el manejador. Acepta `result` opcional con el mismo sobre `{codec, blob}` que los resultados de workflow. `fail_update` la cierra como fallida y acepta `exception_class`, `exception_type` y `non_retryable` opcionales además del `message` obligatorio. diff --git a/i18n/es/source-hashes.json b/i18n/es/source-hashes.json index 27457e918dd..243a665dfb3 100644 --- a/i18n/es/source-hashes.json +++ b/i18n/es/source-hashes.json @@ -9,7 +9,7 @@ "configuration/database-connection.md": "cc83ae77133236309506fa44d39bfd0c939c32a6154c0bd6099bc64c83bdaec9", "configuration/ensuring-same-server.md": "6c665f37cc198c7b1a775a60a94aab5ff4e55383385e76f1834c7840559b512a", "configuration/microservices.md": "46dc4afa07588b78829a7e3d259177ce0cf40861f0e31b88dbb6de3a83aa5488", - "configuration/options.md": "42c40c50ecdf9fc6eace79d212229dfe0dac119c23137225f0ce353952fbd549", + "configuration/options.md": "68478650212fc5a5ddc88da577772b0131b8fe5f931ae8fd19fcb78bdb95ffeb", "configuration/pruning-workflows.md": "6f6ee2be3bd185ffec764e86c3ed3cbd40c45f75d28671b4cd11226493e11afb", "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", @@ -98,7 +98,7 @@ "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", "polyglot/worker-build-id-rollout.md": "62ddf1ca054cf4b83de2fa020f313a153ece00519f804c4f8f30aca53c979af0", "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", - "polyglot/worker-protocol.md": "007e844b0a7ab284b7cd343e79f01a27a0dabee3fe4cf19064170581bb897b85", + "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", "quickstart.md": "887c6b500e17d41e6098f97f62e07ab3f2a05cd94e36aed93bf05fcce7b532e2", "rolling-upgrades.md": "6acff017f2148d4f7553ebd4811aff8bde59cf6da4251845f4240ef7d1b1a970", diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/configuration/options.md b/i18n/fr/docusaurus-plugin-content-docs/current/configuration/options.md index 7d1f71bfd55..37ec227b753 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/configuration/options.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/configuration/options.md @@ -93,7 +93,7 @@ Les surcharges de routage dans `ActivityOptions` s’appliquent lors de la plani Les champs de nouvelle tentative et de délai remplacent la classe de l’activité pour cet appel uniquement : - `maxAttempts` : nombre total de tentatives, la première comprise. Il doit valoir au moins 1. Une nouvelle activité planifiée avec 0 ou moins fait échouer l’exécution. Omettez-le pour utiliser le `$tries` de la classe, où `0` réessaie indéfiniment. -- `backoff` : secondes d’attente avant chaque nouvelle tentative, sous forme de liste ou de valeur unique. Il remplace le `backoff()` de la classe. +- `backoff` : secondes d’attente avant chaque nouvelle tentative, sous forme de liste ou de valeur unique. Il remplace le `backoff()` de la classe. Une fois la liste épuisée, sa dernière valeur est répétée. Une liste vide n’ajoute aucun délai. Voir [Espacement des tentatives](#backoff). - `nonRetryableErrorTypes` : noms de types ou de classes d’erreur qui font échouer l’activité sans nouvelle tentative. - `startToCloseTimeout` : nombre maximal de secondes pour une tentative. - `scheduleToStartTimeout` : nombre maximal de secondes pendant lesquelles une activité peut attendre un worker avant de démarrer. @@ -122,7 +122,11 @@ La classe de base v2 `Activity` n’a pas de propriété de classe `$timeout`. C ## Espacement des tentatives {#backoff} -La méthode `backoff` renvoie un tableau d’entiers correspondant à la tentative courante. Par défaut, la méthode `backoff` applique un espacement exponentiel jusqu’à 2 minutes. Redéfinissez-le en implémentant la méthode `backoff` dans la classe d’activité. +La méthode `backoff()` renvoie les délais de nouvelle tentative en secondes, sous forme d’entier ou de liste. La liste par défaut atteint 120 secondes (2 minutes). Redéfinissez-la en implémentant `backoff()` dans la classe d’activité. + +Lorsque les nouvelles tentatives sont plus nombreuses que les valeurs de la liste, le dernier délai est répété. Avec `maxAttempts: 5` et `backoff: [1, 2]`, les quatre délais de nouvelle tentative sont `[1, 2, 2, 2]` secondes. Une liste vide, `backoff: []`, demande des nouvelles tentatives immédiates sans délai de backoff, sous réserve des limites de tentatives et de temps. + +La politique de nouvelle tentative est enregistrée à la planification de l’activité. Les politiques déjà enregistrées conservent leurs délais si un code ultérieur modifie les valeurs par défaut de la classe ou les options. ## Espace de noms {#namespace} diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md b/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md index dc9d068167b..4838f88123c 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md @@ -331,6 +331,10 @@ commandes typées. Au plus une commande terminale est autorisée par finalisatio `schedule_to_close_timeout` et `heartbeat_timeout`. `retry_policy` utilise `max_attempts`, `backoff_seconds` et `non_retryable_error_types`. +`max_attempts` compte le nombre total de tentatives, première comprise. Une fois `backoff_seconds` épuisé, sa dernière valeur est répétée. Avec `max_attempts: 5` et `backoff_seconds: [1, 2]`, les quatre délais de nouvelle tentative sont `[1, 2, 2, 2]` secondes. Une liste vide, `backoff_seconds: []`, demande des nouvelles tentatives immédiates sans délai de backoff, sous réserve des limites de tentatives et de temps. + +La politique est enregistrée à la planification de l’activité. Conservez ses délais enregistrés pour cette activité, y compris lors d’une relecture avec un SDK ultérieur. Ne les recalculez pas à partir de nouvelles valeurs par défaut. + `start_child_workflow` accepte les champs facultatifs `parent_close_policy`, `retry_policy`, `execution_timeout_seconds` et `run_timeout_seconds`. `parent_close_policy` vaut `abandon`, `request_cancel`, `request_cancellation` diff --git a/i18n/fr/source-hashes.json b/i18n/fr/source-hashes.json index 27457e918dd..243a665dfb3 100644 --- a/i18n/fr/source-hashes.json +++ b/i18n/fr/source-hashes.json @@ -9,7 +9,7 @@ "configuration/database-connection.md": "cc83ae77133236309506fa44d39bfd0c939c32a6154c0bd6099bc64c83bdaec9", "configuration/ensuring-same-server.md": "6c665f37cc198c7b1a775a60a94aab5ff4e55383385e76f1834c7840559b512a", "configuration/microservices.md": "46dc4afa07588b78829a7e3d259177ce0cf40861f0e31b88dbb6de3a83aa5488", - "configuration/options.md": "42c40c50ecdf9fc6eace79d212229dfe0dac119c23137225f0ce353952fbd549", + "configuration/options.md": "68478650212fc5a5ddc88da577772b0131b8fe5f931ae8fd19fcb78bdb95ffeb", "configuration/pruning-workflows.md": "6f6ee2be3bd185ffec764e86c3ed3cbd40c45f75d28671b4cd11226493e11afb", "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", @@ -98,7 +98,7 @@ "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", "polyglot/worker-build-id-rollout.md": "62ddf1ca054cf4b83de2fa020f313a153ece00519f804c4f8f30aca53c979af0", "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", - "polyglot/worker-protocol.md": "007e844b0a7ab284b7cd343e79f01a27a0dabee3fe4cf19064170581bb897b85", + "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", "quickstart.md": "887c6b500e17d41e6098f97f62e07ab3f2a05cd94e36aed93bf05fcce7b532e2", "rolling-upgrades.md": "6acff017f2148d4f7553ebd4811aff8bde59cf6da4251845f4240ef7d1b1a970", diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/configuration/options.md b/i18n/ja/docusaurus-plugin-content-docs/current/configuration/options.md index 55c1d2dc5ae..da87536eb3b 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/configuration/options.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/configuration/options.md @@ -93,7 +93,7 @@ $result = activity( リトライとタイムアウトのフィールドは、この呼び出しに限りアクティビティクラスの設定を上書きします。 - `maxAttempts`:最初の試行を含む総試行回数です。1 以上である必要があります。0 以下で新しいアクティビティをスケジュールすると、実行は失敗します。省略するとクラスの `$tries` を使い、`0` は無期限にリトライします。 -- `backoff`:各リトライ前に待つ秒数で、リストまたは単一の値です。クラスの `backoff()` を上書きします。 +- `backoff`:各リトライ前に待つ秒数で、リストまたは単一の値です。クラスの `backoff()` を上書きします。 リストを使い切ると、最後の値を繰り返します。空のリストは待機時間を追加しません。[バックオフ](#backoff)を参照してください。 - `nonRetryableErrorTypes`:次の試行を行わずにアクティビティを失敗させるエラー型またはクラス名です。 - `startToCloseTimeout`:1 回の試行の最大秒数です。 - `scheduleToStartTimeout`:アクティビティが開始前にワーカーを待てる最大秒数です。 @@ -122,7 +122,11 @@ v2 の基底 `Activity` クラスに `$timeout` プロパティはありませ ## バックオフ {#backoff} -`backoff` メソッドは現在の試行に対応する整数の配列を返します。既定の待機間隔は指数的に長くなり、最大2分です。アクティビティクラスで `backoff` を実装すると上書きできます。 +`backoff()` メソッドは、リトライの待機秒数を整数またはリストで返します。既定のリストは 120 秒(2 分)に達します。アクティビティクラスで `backoff()` を実装すると上書きできます。 + +リトライ回数がリストの要素数を超えると、最後の待機時間を繰り返します。`maxAttempts: 5` と `backoff: [1, 2]` の場合、4 回のリトライ前の待機時間は `[1, 2, 2, 2]` 秒です。空のリスト `backoff: []` は、試行回数とタイムアウトの制限内で、バックオフなしの即時リトライを要求します。 + +リトライポリシーはアクティビティのスケジュール時に記録されます。後のコードがクラスの既定値やオプションを変更しても、記録済みのポリシーは記録された待機時間を維持します。 ## 名前空間 {#namespace} diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md b/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md index b5fd7b565e1..ba496d8f375 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md @@ -249,6 +249,10 @@ Worker は `task` についてルート固有の想定をする前に `poll_stat `schedule_activity` は任意の `retry_policy`、`start_to_close_timeout`、`schedule_to_start_timeout`、`schedule_to_close_timeout`、`heartbeat_timeout` を受け入れます。`retry_policy` は `max_attempts`、`backoff_seconds`、`non_retryable_error_types` を使います。 +`max_attempts` は初回を含む総試行回数です。`backoff_seconds` を使い切ると、最後の値を繰り返します。`max_attempts: 5` と `backoff_seconds: [1, 2]` の場合、4 回のリトライ前の待機時間は `[1, 2, 2, 2]` 秒です。空のリスト `backoff_seconds: []` は、試行回数とタイムアウトの制限内で、バックオフなしの即時リトライを要求します。 + +ポリシーはアクティビティのスケジュール時に記録されます。後の SDK でリプレイする場合も、そのアクティビティに記録された待機時間を維持してください。新しい既定値から再計算しないでください。 + `start_child_workflow` は任意の `parent_close_policy`、`retry_policy`、`execution_timeout_seconds`、`run_timeout_seconds` を受け入れます。`parent_close_policy` は `abandon`、`request_cancel`、`request_cancellation`、`terminate` のいずれかです。`request_cancel` は子を即時に閉じ、`request_cancellation` は元のキャンセル ID と期限で協調クリーンアップを要求します。[協調キャンセル](/docs/polyglot/cancellation)を参照してください。子の再試行ポリシーは、アクティビティと同じ `max_attempts`、`backoff_seconds`、`non_retryable_error_types` の構造です。子の実行失敗後に再試行バックオフを適用します。不正な子開始コマンドはプロトコルエラーであり、子の再試行回数を消費しません。 `complete_update` は Worker のハンドラー適用後、`update_id` の受理済み更新を閉じます。ワークフロー完了結果と同じ `{codec, blob}` エンベロープの任意の `result` を受け入れます。`fail_update` は受理済み更新を失敗として閉じ、必須の `message` に加え、任意の `exception_class`、`exception_type`、`non_retryable` を受け入れます。 diff --git a/i18n/ja/source-hashes.json b/i18n/ja/source-hashes.json index 27457e918dd..243a665dfb3 100644 --- a/i18n/ja/source-hashes.json +++ b/i18n/ja/source-hashes.json @@ -9,7 +9,7 @@ "configuration/database-connection.md": "cc83ae77133236309506fa44d39bfd0c939c32a6154c0bd6099bc64c83bdaec9", "configuration/ensuring-same-server.md": "6c665f37cc198c7b1a775a60a94aab5ff4e55383385e76f1834c7840559b512a", "configuration/microservices.md": "46dc4afa07588b78829a7e3d259177ce0cf40861f0e31b88dbb6de3a83aa5488", - "configuration/options.md": "42c40c50ecdf9fc6eace79d212229dfe0dac119c23137225f0ce353952fbd549", + "configuration/options.md": "68478650212fc5a5ddc88da577772b0131b8fe5f931ae8fd19fcb78bdb95ffeb", "configuration/pruning-workflows.md": "6f6ee2be3bd185ffec764e86c3ed3cbd40c45f75d28671b4cd11226493e11afb", "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", @@ -98,7 +98,7 @@ "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", "polyglot/worker-build-id-rollout.md": "62ddf1ca054cf4b83de2fa020f313a153ece00519f804c4f8f30aca53c979af0", "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", - "polyglot/worker-protocol.md": "007e844b0a7ab284b7cd343e79f01a27a0dabee3fe4cf19064170581bb897b85", + "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", "quickstart.md": "887c6b500e17d41e6098f97f62e07ab3f2a05cd94e36aed93bf05fcce7b532e2", "rolling-upgrades.md": "6acff017f2148d4f7553ebd4811aff8bde59cf6da4251845f4240ef7d1b1a970", diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/configuration/options.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/configuration/options.md index fe4604bd156..0288575e95b 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/configuration/options.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/configuration/options.md @@ -93,7 +93,7 @@ As substituições de roteamento em `ActivityOptions` se aplicam ao agendar uma Os campos de nova tentativa e tempo limite substituem a classe da atividade apenas nesta chamada: - `maxAttempts`: total de tentativas, contando a primeira. Deve ser pelo menos 1. Uma nova atividade agendada com 0 ou menos faz a execução falhar. Omita-o para usar o `$tries` da classe, em que `0` tenta indefinidamente. -- `backoff`: segundos de espera antes de cada nova tentativa, como lista ou valor único. Substitui o `backoff()` da classe. +- `backoff`: segundos de espera antes de cada nova tentativa, como lista ou valor único. Substitui o `backoff()` da classe. Quando a lista termina, sua última entrada é repetida. Uma lista vazia não acrescenta atraso. Veja [Intervalo entre tentativas](#backoff). - `nonRetryableErrorTypes`: nomes de tipos ou classes de erro que fazem a atividade falhar sem outra tentativa. - `startToCloseTimeout`: máximo de segundos para uma tentativa. - `scheduleToStartTimeout`: máximo de segundos que uma atividade pode esperar por um worker antes de começar. @@ -122,7 +122,11 @@ A classe base `Activity` da v2 não tem uma propriedade de classe `$timeout`. Co ## Intervalo entre tentativas {#backoff} -O método `backoff` retorna um array de inteiros correspondentes à tentativa atual. O método `backoff` padrão aplica um recuo exponencial até 2 minutos. Você pode substituí-lo implementando o método `backoff` na classe da atividade. +O método `backoff()` retorna os atrasos de nova tentativa em segundos como inteiro ou lista. A lista padrão chega a 120 segundos (2 minutos). Substitua-a implementando `backoff()` na classe da atividade. + +Quando há mais novas tentativas que entradas na lista, o último atraso é repetido. Com `maxAttempts: 5` e `backoff: [1, 2]`, os quatro atrasos de nova tentativa são `[1, 2, 2, 2]` segundos. Uma lista vazia, `backoff: []`, solicita novas tentativas imediatas sem backoff, sujeitas aos limites de tentativas e tempo. + +A política de novas tentativas é registrada quando a atividade é agendada. Políticas já registradas mantêm seus atrasos quando código posterior muda os padrões da classe ou as opções. ## Namespace {#namespace} diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md index ac6b75a910d..e8a1ded44ab 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md @@ -322,6 +322,10 @@ No máximo um comando terminal é permitido por conclusão. `schedule_to_close_timeout` e `heartbeat_timeout`. `retry_policy` usa `max_attempts`, `backoff_seconds` e `non_retryable_error_types`. +`max_attempts` conta o total de tentativas, incluindo a primeira. Quando `backoff_seconds` termina, sua última entrada é repetida. Com `max_attempts: 5` e `backoff_seconds: [1, 2]`, os quatro atrasos de nova tentativa são `[1, 2, 2, 2]` segundos. Uma lista vazia, `backoff_seconds: []`, solicita novas tentativas imediatas sem backoff, sujeitas aos limites de tentativas e tempo. + +A política é registrada quando a atividade é agendada. Preserve seus atrasos registrados para essa atividade, inclusive no replay com um SDK posterior. Não os recalcule a partir de novos padrões. + `start_child_workflow` aceita `parent_close_policy`, `retry_policy`, `execution_timeout_seconds` e `run_timeout_seconds` opcionais. `parent_close_policy` é `abandon`, `request_cancel`, `request_cancellation` diff --git a/i18n/pt-BR/source-hashes.json b/i18n/pt-BR/source-hashes.json index 27457e918dd..243a665dfb3 100644 --- a/i18n/pt-BR/source-hashes.json +++ b/i18n/pt-BR/source-hashes.json @@ -9,7 +9,7 @@ "configuration/database-connection.md": "cc83ae77133236309506fa44d39bfd0c939c32a6154c0bd6099bc64c83bdaec9", "configuration/ensuring-same-server.md": "6c665f37cc198c7b1a775a60a94aab5ff4e55383385e76f1834c7840559b512a", "configuration/microservices.md": "46dc4afa07588b78829a7e3d259177ce0cf40861f0e31b88dbb6de3a83aa5488", - "configuration/options.md": "42c40c50ecdf9fc6eace79d212229dfe0dac119c23137225f0ce353952fbd549", + "configuration/options.md": "68478650212fc5a5ddc88da577772b0131b8fe5f931ae8fd19fcb78bdb95ffeb", "configuration/pruning-workflows.md": "6f6ee2be3bd185ffec764e86c3ed3cbd40c45f75d28671b4cd11226493e11afb", "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", @@ -98,7 +98,7 @@ "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", "polyglot/worker-build-id-rollout.md": "62ddf1ca054cf4b83de2fa020f313a153ece00519f804c4f8f30aca53c979af0", "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", - "polyglot/worker-protocol.md": "007e844b0a7ab284b7cd343e79f01a27a0dabee3fe4cf19064170581bb897b85", + "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", "quickstart.md": "887c6b500e17d41e6098f97f62e07ab3f2a05cd94e36aed93bf05fcce7b532e2", "rolling-upgrades.md": "6acff017f2148d4f7553ebd4811aff8bde59cf6da4251845f4240ef7d1b1a970", diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/configuration/options.md b/i18n/uk/docusaurus-plugin-content-docs/current/configuration/options.md index defd0a1dc13..1c5611d3472 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/configuration/options.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/configuration/options.md @@ -93,7 +93,7 @@ $result = activity( Поля повторних спроб і тайм-аутів перевизначають клас activity лише для цього виклику: - `maxAttempts`: загальна кількість спроб, включно з першою. Значення має бути не менше 1. Нова activity, запланована з 0 або меншим значенням, завершує запуск помилкою. Пропустіть поле, щоб використати `$tries` класу, де `0` означає нескінченні повторення. -- `backoff`: секунди очікування перед кожною повторною спробою, списком або одним значенням. Перевизначає `backoff()` класу. +- `backoff`: секунди очікування перед кожною повторною спробою, списком або одним значенням. Перевизначає `backoff()` класу. Коли список вичерпано, його останнє значення повторюється. Порожній список не додає затримки. Див. [Затримка між спробами](#backoff). - `nonRetryableErrorTypes`: назви типів або класів помилок, які завершують activity помилкою без нової спроби. - `startToCloseTimeout`: максимальна кількість секунд на одну спробу. - `scheduleToStartTimeout`: максимальна кількість секунд, протягом яких activity може чекати на worker до старту. @@ -122,7 +122,11 @@ $result = activity( ## Затримка між спробами {#backoff} -Метод `backoff` повертає масив цілих чисел відповідно до поточної спроби. Типовий `backoff` задає експоненційну затримку до 2 хвилин. Це можна перевизначити реалізацією методу `backoff` у класі activity. +Метод `backoff()` повертає затримки повторних спроб у секундах як ціле число або список. Типовий список доходить до 120 секунд (2 хвилин). Перевизначте його, реалізувавши `backoff()` у класі activity. + +Коли повторних спроб більше, ніж елементів списку, остання затримка повторюється. Для `maxAttempts: 5` і `backoff: [1, 2]` чотири затримки перед повторними спробами становлять `[1, 2, 2, 2]` секунди. Порожній список `backoff: []` запитує негайні повторні спроби без backoff у межах обмежень кількості спроб і часу. + +Політика повторних спроб записується під час планування activity. Уже записані політики зберігають свої затримки, коли пізніший код змінює типові значення класу або опції. ## Простір імен {#namespace} diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md b/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md index e1e6a3bc710..77d332061dc 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md @@ -330,6 +330,10 @@ Endpoints і тіла запитів: `retry_policy` використовує `max_attempts`, `backoff_seconds` і `non_retryable_error_types`. +`max_attempts` рахує загальну кількість спроб, включно з першою. Коли `backoff_seconds` вичерпано, його останнє значення повторюється. Для `max_attempts: 5` і `backoff_seconds: [1, 2]` чотири затримки перед повторними спробами становлять `[1, 2, 2, 2]` секунди. Порожній список `backoff_seconds: []` запитує негайні повторні спроби без backoff у межах обмежень кількості спроб і часу. + +Політика записується під час планування activity. Зберігайте записані затримки для цієї activity, зокрема під час replay з пізнішим SDK. Не перераховуйте їх із нових типових значень. + `start_child_workflow` приймає необов'язкові `parent_close_policy`, `retry_policy`, `execution_timeout_seconds` та `run_timeout_seconds`. `parent_close_policy` є `abandon`, `request_cancel`, diff --git a/i18n/uk/source-hashes.json b/i18n/uk/source-hashes.json index 27457e918dd..243a665dfb3 100644 --- a/i18n/uk/source-hashes.json +++ b/i18n/uk/source-hashes.json @@ -9,7 +9,7 @@ "configuration/database-connection.md": "cc83ae77133236309506fa44d39bfd0c939c32a6154c0bd6099bc64c83bdaec9", "configuration/ensuring-same-server.md": "6c665f37cc198c7b1a775a60a94aab5ff4e55383385e76f1834c7840559b512a", "configuration/microservices.md": "46dc4afa07588b78829a7e3d259177ce0cf40861f0e31b88dbb6de3a83aa5488", - "configuration/options.md": "42c40c50ecdf9fc6eace79d212229dfe0dac119c23137225f0ce353952fbd549", + "configuration/options.md": "68478650212fc5a5ddc88da577772b0131b8fe5f931ae8fd19fcb78bdb95ffeb", "configuration/pruning-workflows.md": "6f6ee2be3bd185ffec764e86c3ed3cbd40c45f75d28671b4cd11226493e11afb", "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", @@ -98,7 +98,7 @@ "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", "polyglot/worker-build-id-rollout.md": "62ddf1ca054cf4b83de2fa020f313a153ece00519f804c4f8f30aca53c979af0", "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", - "polyglot/worker-protocol.md": "007e844b0a7ab284b7cd343e79f01a27a0dabee3fe4cf19064170581bb897b85", + "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", "quickstart.md": "887c6b500e17d41e6098f97f62e07ab3f2a05cd94e36aed93bf05fcce7b532e2", "rolling-upgrades.md": "6acff017f2148d4f7553ebd4811aff8bde59cf6da4251845f4240ef7d1b1a970", diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/configuration/options.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/configuration/options.md index a727225097a..ff5e0f2cde7 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/configuration/options.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/configuration/options.md @@ -93,7 +93,7 @@ $result = activity( 重试和超时字段仅在本次调用中覆盖活动类的设置: - `maxAttempts`:总尝试次数,包括第一次。必须至少为 1。以 0 或更小的值调度新活动会使运行失败。省略该字段则使用类的 `$tries`,其中 `0` 表示无限重试。 -- `backoff`:每次重试前等待的秒数,可以是列表或单个值。它覆盖类的 `backoff()`。 +- `backoff`:每次重试前等待的秒数,可以是列表或单个值。它覆盖类的 `backoff()`。 列表用尽后会重复最后一项。空列表不会增加延迟。请参阅[退避](#backoff)。 - `nonRetryableErrorTypes`:不再尝试、直接使活动失败的错误类型或类名。 - `startToCloseTimeout`:单次尝试的最长秒数。 - `scheduleToStartTimeout`:活动开始前等待工作器的最长秒数。 @@ -122,7 +122,11 @@ v2 `Activity` 基类没有 `$timeout` 类属性。请通过 [`ActivityOptions`]( ## 退避 {#backoff} -`backoff` 方法返回整数数组,各项对应相应尝试的退避时间。默认 `backoff` 采用指数退避,最长为 2 分钟。可在活动类中实现 `backoff` 方法进行覆盖。 +`backoff()` 方法以整数或列表返回重试延迟秒数。默认列表最长为 120 秒(2 分钟)。可在活动类中实现 `backoff()` 进行覆盖。 + +当重试次数超过列表项数时,会重复最后一个延迟。对于 `maxAttempts: 5` 和 `backoff: [1, 2]`,四次重试前的延迟为 `[1, 2, 2, 2]` 秒。空列表 `backoff: []` 请求在尝试次数和超时限制内立即重试,不增加退避时间。 + +重试策略在调度活动时记录。之后的代码即使更改类默认值或选项,已记录策略仍保留原有延迟。 ## 命名空间 {#namespace} diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md index ed66c90c7a7..2425726dfff 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/worker-protocol.md @@ -249,6 +249,10 @@ Worker 应先按 `poll_status` 分支处理,再对 `task` 做路由专用假 `schedule_activity` 接受可选的 `retry_policy`、`start_to_close_timeout`、`schedule_to_start_timeout`、`schedule_to_close_timeout` 和 `heartbeat_timeout` 字段。`retry_policy` 使用 `max_attempts`、`backoff_seconds` 和 `non_retryable_error_types`。 +`max_attempts` 表示包含首次尝试在内的总尝试次数。`backoff_seconds` 用尽后会重复最后一项。对于 `max_attempts: 5` 和 `backoff_seconds: [1, 2]`,四次重试前的延迟为 `[1, 2, 2, 2]` 秒。空列表 `backoff_seconds: []` 请求在尝试次数和超时限制内立即重试,不增加退避时间。 + +策略在调度活动时记录。请保留该活动已记录的延迟,包括使用较新 SDK 进行重放时。不要根据新的默认值重新计算。 + `start_child_workflow` 接受可选的 `parent_close_policy`、`retry_policy`、`execution_timeout_seconds` 和 `run_timeout_seconds` 字段。`parent_close_policy` 为 `abandon`、`request_cancel`、`request_cancellation` 或 `terminate` 之一。`request_cancel` 立即关闭子工作流;`request_cancellation` 携带原始取消标识和截止时间请求协作式清理,参见[协作式取消](/docs/polyglot/cancellation)。子工作流重试策略使用与活动相同的 `max_attempts`、`backoff_seconds` 和 `non_retryable_error_types` 对象结构。重试退避在子运行失败后应用;无效子工作流启动命令属于协议错误,不消耗子工作流重试次数。 `complete_update` 在 Worker 应用更新处理器后,关闭 `update_id` 指定的已接受更新。它接受可选的 `result` 负载,使用与工作流完成结果相同的 `{codec, blob}` 封装。`fail_update` 将已接受更新关闭为失败,除必填 `message` 外,还接受可选的 `exception_class`、`exception_type` 和 `non_retryable` 字段。 diff --git a/i18n/zh-Hans/source-hashes.json b/i18n/zh-Hans/source-hashes.json index 27457e918dd..243a665dfb3 100644 --- a/i18n/zh-Hans/source-hashes.json +++ b/i18n/zh-Hans/source-hashes.json @@ -9,7 +9,7 @@ "configuration/database-connection.md": "cc83ae77133236309506fa44d39bfd0c939c32a6154c0bd6099bc64c83bdaec9", "configuration/ensuring-same-server.md": "6c665f37cc198c7b1a775a60a94aab5ff4e55383385e76f1834c7840559b512a", "configuration/microservices.md": "46dc4afa07588b78829a7e3d259177ce0cf40861f0e31b88dbb6de3a83aa5488", - "configuration/options.md": "42c40c50ecdf9fc6eace79d212229dfe0dac119c23137225f0ce353952fbd549", + "configuration/options.md": "68478650212fc5a5ddc88da577772b0131b8fe5f931ae8fd19fcb78bdb95ffeb", "configuration/pruning-workflows.md": "6f6ee2be3bd185ffec764e86c3ed3cbd40c45f75d28671b4cd11226493e11afb", "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", @@ -98,7 +98,7 @@ "polyglot/visibility-query-language.md": "15790074c904c6cdbb1de8dfade95ea9ca6391f2f16412db517a2fb84ef08334", "polyglot/worker-build-id-rollout.md": "62ddf1ca054cf4b83de2fa020f313a153ece00519f804c4f8f30aca53c979af0", "polyglot/worker-compatibility-routing.md": "ef58f23c112f0e6b968927ba861177903adca21ed33b6b9371681e23a18b2994", - "polyglot/worker-protocol.md": "007e844b0a7ab284b7cd343e79f01a27a0dabee3fe4cf19064170581bb897b85", + "polyglot/worker-protocol.md": "91b18b39d626c1288bfa3f6b8212fa8246aa14393cb489a39fe90379bc4cd4b2", "polyglot/workflow-streams.md": "5675a8ea1b9d0b1f7223fecb90b3b048d3006670bf505950bc783709287a6432", "quickstart.md": "887c6b500e17d41e6098f97f62e07ab3f2a05cd94e36aed93bf05fcce7b532e2", "rolling-upgrades.md": "6acff017f2148d4f7553ebd4811aff8bde59cf6da4251845f4240ef7d1b1a970",