Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirm some test cases for retry policy #2624

Open
jeffhollan opened this issue Nov 4, 2020 · 4 comments
Open

Confirm some test cases for retry policy #2624

jeffhollan opened this issue Nov 4, 2020 · 4 comments
Assignees
Milestone

Comments

@jeffhollan
Copy link

jeffhollan commented Nov 4, 2020

Per early feedback and questions around retry policy, want to test a few scenarios to confirm:

Scale controller behavior

  • If you have a queue triggered function and retry it 100 times with a 5 minute delay between executions, will the execution logs or locked queue message prevent it from scaling to 0?
  • If you have a queue triggered function and retry it 100 times with a 30 minute delay between executions, will the execution logs or locked queue message prevent if rom scaling to 0?
  • Same thing with event hubs for both of the above

Queue retry behavior

  • If you have a 10 minute delay in a service bus message, and a lock renew period of 30 seconds (I believe the default), will we continue to renew the lock during the delay?

Function timeout

  • DotNet functions running in host process:

    • On function invocation timeout, host instance is shutdown. Retry count is not persisted and invocation will start on a new functions host instance with attempt 0
  • Non DotNet functions running in a language worker process

    • On function invocation timeout, host tries to restart language worker process. Retry-count is persisted as function invocations are handled by the same functions host instance.

Drain Mode

If Drain api is called while function executions are waiting on retries, retries will continue as long as function host instance is not teared down. Any trigger listeners will be gracefully shutdown and new invocations will not be happening on this function host instance.

@ghost ghost assigned mathewc Nov 4, 2020
@jeffhollan jeffhollan added this to the Triaged milestone Nov 4, 2020
@jeffhollan jeffhollan assigned pragnagopa and jeffhollan and unassigned mathewc Nov 4, 2020
@pragnagopa
Copy link
Member

Tested and added notes for FunctionTimeout and Drain Mode section in the description.

@pragnagopa
Copy link
Member

Test : Consumption plan + Azure Storage Queue Trigger + Infinite Retries

By default Azure Storage Queue Trigger retries 5 times i.e. dequeueCount < 5 . If Message dequeue count exceeds 5, message is moved to poison queue.

If host retry is configured, on a single host instance message will be retried without incrementing dequeueCount. If the host instance goes down, then message will be picked up by a new host instance and dequeueCount will be incremented.

If over a period of time, message is processed by 5 different host instances, then message will be moved to poison queue as dequeueCount for the message is now 5.

Test files used:

host.json

{
  "version": "2.0",
  "retry": {
    "strategy": "fixedDelay",
    "maxRetryCount": -1,
    "delayInterval":"00:00:30"
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[1.*, 2.0.0)"
  }
}

index.js

module.exports = async function (context, myQueueItem) {
    context.log('JavaScript queue trigger function processed work item', myQueueItem);
    throw new Error('An error occurred');
};

@fabiocav
Copy link
Member

fabiocav commented Jun 1, 2022

@alrod @AnatoliB is this still relevant? Are you tracking this elsewhere?

@fabiocav
Copy link
Member

fabiocav commented Jun 1, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants