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

Verify max value for maxPollingInterval #2967

Open
hossam-nasr opened this issue Mar 11, 2023 · 0 comments
Open

Verify max value for maxPollingInterval #2967

hossam-nasr opened this issue Mar 11, 2023 · 0 comments

Comments

@hossam-nasr
Copy link

hossam-nasr commented Mar 11, 2023

This issue was inspired by this CRI. Track 2 version: Azure/azure-sdk-for-net#34858

In the storage queue extension trigger, the extension polls the queue in extension to check for new messages. If it fails, it waits a certain amount of time, the polling interval, between polling the queue again. The polling algorithm is described in the docs here. The polling interval increases exponentially in the case of failure, up to a maximum value of the maxPollingInterval set by the user (default is 1 minute). However, if the user misconfigures the maxPollingInterval property (as was the case in the CRI), it can result in very long polling intervals, leading to periods of downtime in the app. We have a safeguard to check against a minimum value of maxPollingInterval, but we should add a check for an upper on that value as well, to at least warn the user about the potential problems.

This is also exacerbated by how maxPollingInterval relies on the TimeSpan.Parse() function:

TimeSpan ts = TimeSpan.Parse("10000");
Console.WriteLine(ts);
Console.WriteLine($"TotalDays: {ts.TotalDays}");

Output:

10000.00:00:00
TotalDays: 10000

Which makes it easy to accidentally configure an almost infinitely long maxPollingInterval

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

No branches or pull requests

2 participants