Skip to content

Reload modules when not in placeholder mode #1340

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

Merged
merged 10 commits into from
Nov 3, 2023

Conversation

gavin-aguiar
Copy link
Contributor

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

Description

In linux consumption, when the host restarts the python worker due to any reason (timeout/OOM..), the host does not send an EnvironmentReload request since it assumes that the container has already been specialized. Due to this customer modules are not loaded and that causes the function app to fail with ModuleNotFound errors.
Fix here is to load customer modules when the container is not in placeholder mode for linux consumption.

Fixes #1350


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

Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Merging #1340 (5683d3e) into dev (1a21fa5) will decrease coverage by 53.79%.
The diff coverage is 71.42%.

❗ Current head 5683d3e differs from pull request most recent head 4a59541. Consider uploading reports for the commit 4a59541 to get more accurate results

@@             Coverage Diff             @@
##              dev    #1340       +/-   ##
===========================================
- Coverage   85.96%   32.18%   -53.79%     
===========================================
  Files          34       34               
  Lines        1938     1942        +4     
  Branches      366      366               
===========================================
- Hits         1666      625     -1041     
- Misses        205     1316     +1111     
+ Partials       67        1       -66     
Flag Coverage Δ
unittests 32.18% <71.42%> (-53.73%) ⬇️

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

Files Coverage Δ
azure_functions_worker/logging.py 34.61% <100.00%> (-10.49%) ⬇️
azure_functions_worker/dispatcher.py 19.04% <0.00%> (-68.68%) ⬇️
azure_functions_worker/utils/dependency.py 33.82% <75.00%> (-55.66%) ⬇️

... and 21 files with indirect coverage changes

@gavin-aguiar gavin-aguiar marked this pull request as ready for review November 1, 2023 00:46
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.

[BUG] Module Not Found in Consumption when worker crashes (OOM/TO/sys.exit)
2 participants