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

Attribute error fix for retry policy #1322

Merged
merged 3 commits into from
Oct 10, 2023
Merged

Conversation

gavin-aguiar
Copy link
Contributor

@gavin-aguiar gavin-aguiar commented Oct 6, 2023

Description

With the current release, python worker was failing with the following error
Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException : Result: Failure Exception: AttributeError: 'Function' object has no attribute 'get_settings_dict' Stack: File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py', line 345, in _handle__functions_metadata_request fx_metadata_results = self.index_functions(function_path) File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py', line 622, in index_functions fx_metadata_results = loader.process_indexed_function( File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py', line 109, in process_indexed_function retry_protos = build_retry_protos(indexed_function) File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py', line 69, in build_retry_protos retry = indexed_function.get_settings_dict(RETRY_POLICY)

This error is caused in dedicated due the python worker using the library that the customer brings in. To fix this error we check if the get_settings_api attribute exists and then proceed with retry policy else set retry policy to None

Fixes #


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and CI is passing.

Quality of Code and Contribution Guidelines

@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Merging #1322 (5371466) into dev (82b988e) will decrease coverage by 53.37%.
The diff coverage is 21.05%.

❗ Current head 5371466 differs from pull request most recent head 6e3d652. Consider uploading reports for the commit 6e3d652 to get more accurate results

@@             Coverage Diff             @@
##              dev    #1322       +/-   ##
===========================================
- Coverage   85.46%   32.09%   -53.37%     
===========================================
  Files          34       34               
  Lines        1926     1938       +12     
  Branches      366      366               
===========================================
- Hits         1646      622     -1024     
- Misses        209     1315     +1106     
+ Partials       71        1       -70     
Flag Coverage Δ
unittests 32.09% <21.05%> (-53.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
azure_functions_worker/loader.py 31.57% <21.05%> (-55.68%) ⬇️

... and 23 files with indirect coverage changes

@gavin-aguiar gavin-aguiar changed the title ModuleNotFound error fix for retry policy Attribute error fix for retry policy Oct 9, 2023
@gavin-aguiar gavin-aguiar merged commit 72ec585 into dev Oct 10, 2023
51 of 52 checks passed
@gavin-aguiar gavin-aguiar deleted the gaaguiar/retry_mnf_fix branch October 10, 2023 15:21
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

Successfully merging this pull request may close these issues.

2 participants