Skip to content

Commit a2c590e

Browse files
authored
Merge pull request #105390 from cgillum/patch-11
Add note that instances termination is asynchronous
2 parents 90e7212 + 2aff085 commit a2c590e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

articles/azure-functions/durable/durable-functions-instance-management.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func durable get-instances --created-after 2018-03-10T13:57:31Z --created-before
351351

352352
If you have an orchestration instance that is taking too long to run, or you just need to stop it before it completes for any reason, you have the option to terminate it.
353353

354-
You can use the `TerminateAsync` (.NET) or the `terminate` (JavaScript) method of the [orchestration client binding](durable-functions-bindings.md#orchestration-client) to terminate instances. The two parameters are an `instanceId` and a `reason` string, which are written to logs and to the instance status. A terminated instance stops running as soon as it reaches the next `await` (.NET) or `yield` (JavaScript) point, or it terminates immediately if it's already on an `await` or `yield`.
354+
You can use the `TerminateAsync` (.NET) or the `terminate` (JavaScript) method of the [orchestration client binding](durable-functions-bindings.md#orchestration-client) to terminate instances. The two parameters are an `instanceId` and a `reason` string, which are written to logs and to the instance status.
355355

356356
# [C#](#tab/csharp)
357357

@@ -386,6 +386,8 @@ See [Start instances](#javascript-function-json) for the function.json configura
386386

387387
---
388388

389+
A terminated instance will eventually transition into the `Terminated` state. However, this transition will not happen immediately. Rather, the terminate operation will be queued in the task hub along with other operations for that instance. You can use the [instance query](#query-instances) APIs to know when a terminated instance has actually reached the `Terminated` state.
390+
389391
> [!NOTE]
390392
> Instance termination doesn't currently propagate. Activity functions and sub-orchestrations run to completion, regardless of whether you've terminated the orchestration instance that called them.
391393
@@ -794,4 +796,4 @@ func durable delete-task-hub --task-hub-name UserTest
794796
> [Learn how to handle versioning](durable-functions-versioning.md)
795797
796798
> [!div class="nextstepaction"]
797-
> [Built-in HTTP API reference for instance management](durable-functions-http-api.md)
799+
> [Built-in HTTP API reference for instance management](durable-functions-http-api.md)

0 commit comments

Comments
 (0)