You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately I am unable to find any examples or documentation, or even references to possible options for the strategy in the python package. E.g. should strategy be fixedDelay or fixed_delay?
Edit to make the confusion a bit more clear:
def retry(self,
strategy: str,
max_retry_count: str,
delay_interval: Optional[str] = None,
minimum_interval: Optional[str] = None,
maximum_interval: Optional[str] = None,
setting_extra_fields: Dict[str, Any] = {},
) -> Callable[..., Any]:
"""The retry decorator adds :class:`RetryPolicy` to the function
settings object for building :class:`Function` object used in worker
function indexing model. This is equivalent to defining RetryPolicy
in the function.json which enables function to retry on failure.
All optional fields will be given default value by function host when
they are parsed by function host.
Ref: https://aka.ms/azure_functions_retries
:param strategy: The retry strategy to use.
:param max_retry_count: The maximum number of retry attempts.
:param delay_interval: The delay interval between retry attempts.
:param minimum_interval: The minimum delay interval between retry
attempts.
:param maximum_interval: The maximum delay interval between retry
attempts.
:param setting_extra_fields: Keyword arguments for specifying
additional setting fields.
:return: Decorator function.
"""
The URL in the docstring refers to a V1 function model documentation with camel case for things like maxRetryCount, which is converted to max_retry_count in Python (makes sense, but please add docs at least somewhere). Nowhere it states whether the input fixedDelay should now be turned into fixed_delay. Then we have the max_retry_count which is a number in the V1 model function.json files, but the V2 docstring states this has to be a string. It annoys me that I always have to blindly try all options with these things while all it takes is one simple example. Sorry for the outing of my frustration.
WORKING EXAMPLE (for anyone referring to this thread later):
Hi Giel (@ogiel), Thanks for the feedback and apologies for the confusion. As you mentioned, all names are snake cased. We'll definitely add some examples for retries with the v2 programming model.
Activity
vrdmr commentedon Jul 10, 2023
Tasks completed - waiting for release - should be part of 4.25
ogiel commentedon Feb 13, 2024
Could any example be given on how to use retry policies on V2 functions? Everything I try results in no functions shown in the function app:
If i comment out the @app.retry() it works.
Unfortunately I am unable to find any examples or documentation, or even references to possible options for the strategy in the python package. E.g. should strategy be fixedDelay or fixed_delay?
Edit to make the confusion a bit more clear:
The URL in the docstring refers to a V1 function model documentation with camel case for things like maxRetryCount, which is converted to max_retry_count in Python (makes sense, but please add docs at least somewhere). Nowhere it states whether the input fixedDelay should now be turned into fixed_delay. Then we have the max_retry_count which is a number in the V1 model function.json files, but the V2 docstring states this has to be a string. It annoys me that I always have to blindly try all options with these things while all it takes is one simple example. Sorry for the outing of my frustration.
WORKING EXAMPLE (for anyone referring to this thread later):
Conclusion, all names are converted from pascal to pythonic snake case and integers are converted to strings containing... integers. Good luck.
gavin-aguiar commentedon Feb 13, 2024
Hi Giel (@ogiel), Thanks for the feedback and apologies for the confusion. As you mentioned, all names are snake cased. We'll definitely add some examples for retries with the v2 programming model.