Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/configuration/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions docs/polyglot/worker-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions i18n/de/source-hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions i18n/es/source-hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions i18n/fr/source-hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading
Loading