[Python] Durable function retry settings

Discussão em 'Python' iniciado por Stack, Fevereiro 18, 2025.

  1. Stack

    Stack Membro Participativo

    I wrote an Azure Function App with Durable Functions. While testing with a large dataset, I realized that the functionTimeout value was 10 mins. This caused some of the orchestrations to timeout. Thus began an indefinite number of retries of the failed orchestrations. I have increased the timeout setting to 1 hour 30 mins, but some of the old retries are still pending and therefore still running. I have tried stopping the function app and restarting it back up, but the execution of the orchestrations continued.

    Two questions:

    1. Is there a manual way to stop the execution of the orchestrations other than stopping the function app?
    2. How do I set the number of retries to 0?

    Here's the code for initiating the orchestrations:

    import azure.functions as func
    import azure.durable_functions as df
    from CommonCMPfunc import *
    import logging


    app = df.DFApp(http_auth_level=func.AuthLevel.FUNCTION)

    #HTTP triggered function invoked by the client
    @app.route(route="orchestrators/{functionName}/{stateabbr}/{county}")
    @app.durable_client_input(client_name="starter")
    async def CleanMatchEnrichParcel(req: func.HttpRequest, starter: str) -> func.HttpResponse:
    logging.info("CleanMatchEnrichParcel HTTP trigger function processed a request.")
    fname = req.route_params["functionName"]
    stateabbr = req.route_params["stateabbr"]
    county = req.route_params["county"]
    fparams = {"stateabbr": stateabbr, "county": county}
    instance_id = await starter.start_new(fname, None, fparams)
    logging.info(f"Started orchestration with ID = '{instance_id}'.")
    response = starter.create_check_status_response(req, instance_id)
    return(response)

    @app.orchestration_trigger(context_name="context")
    def orchestrator_function(context: df.DurableOrchestrationContext):
    #orchestration function code
    return(response)

    Continue reading...

Compartilhe esta Página