Azure / azure-functions-durable-python

Python library for using the Durable Functions bindings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect error message in `DurableOrchestrationClient.terminate()`

kogad opened this issue Β· comments

commented

πŸ› Describe the bug

DurableOrchestrationClient.terminate() throws following exception when specified non-existent instance_id.

[2023-03-29T13:32:06.034Z] Exception: Exception: <function DurableOrchestrationClient.terminate.<locals>.<lambda>.<locals>.<lambda> at 0x7fac48898d30>
[2023-03-29T13:32:06.035Z] Stack:   File "/usr/lib/azure-functions-core-tools-4/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 444, in _handle__invocation_request
[2023-03-29T13:32:06.035Z]     call_result = await self._run_async_func(
[2023-03-29T13:32:06.036Z]   File "/usr/lib/azure-functions-core-tools-4/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 697, in _run_async_func
[2023-03-29T13:32:06.036Z]     return await ExtensionManager.get_async_invocation_wrapper(
[2023-03-29T13:32:06.036Z]   File "/usr/lib/azure-functions-core-tools-4/workers/python/3.9/LINUX/X64/azure_functions_worker/extension.py", line 147, in get_async_invocation_wrapper
[2023-03-29T13:32:06.036Z]     result = await function(**args)
[2023-03-29T13:32:06.036Z]   File "/home/foo/TestExceptionWhenTerminate/__init__.py", line 8, in main
[2023-03-29T13:32:06.036Z]     await client.terminate("dummyinstanceid", "foo")
[2023-03-29T13:32:06.036Z]   File "/home/foo/.venv/lib/python3.9/site-packages/azure/durable_functions/models/DurableOrchestrationClient.py", line 481, in terminate
[2023-03-29T13:32:06.036Z]     raise Exception(error_message)

πŸ€” Expected behavior

The error message should be like No instance with ID 'dummyinstanceid' found.

β˜• Steps to reproduce

What Durable Functions patterns are you using, if any?

Durable Functions HTTP starter

Any minimal reproducer we can use?

The following code reproduces this bug:

import azure.durable_functions as df
import azure.functions as func


async def main(req: func.HttpRequest, starter: str) -> func.HttpResponse:
    client = df.DurableOrchestrationClient(starter)

    await client.terminate("dummyinstanceid", "foo")

    return func.HttpResponse(status_code=200)

Are you running this locally or on Azure?

I am running this locally with following versions.

azure-functions==1.13.3
azure-functions-durable==1.2.2

⚑If deployed to Azure

We have access to a lot of telemetry that can help with investigations. Please provide as much of the following information as you can to help us investigate!

  • Timeframe issue observed:
  • Function App name:
  • Function name(s):
  • Azure region:
  • Orchestration instance ID(s):
  • Azure storage account name:

If you don't want to share your Function App or storage account name GitHub, please at least share the orchestration instance ID. Otherwise it's extremely difficult to look up information.