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

Enforce function timeout at worker level. #5464

Merged
merged 4 commits into from
Jan 31, 2023
Merged

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Jan 25, 2023

Function timeout for emulator was enforced by the emulated function process.

Here we pull out the timeout enforcement at the worker level (analogous to "Data Plane" in production environment). When timeout is reached, the worker will abort the triggering request and kill the child process.

This refactor will remove the need to write code for enforcing timeout for emulated python functions.

@taeold taeold force-pushed the dl_emulator_timeout branch 4 times, most recently from 562b33e to e1820fb Compare January 25, 2023 19:35
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2023

Codecov Report

Base: 56.30% // Head: 56.29% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (d1a42b2) compared to base (06b8bad).
Patch coverage: 62.79% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5464      +/-   ##
==========================================
- Coverage   56.30%   56.29%   -0.01%     
==========================================
  Files         315      315              
  Lines       21348    21366      +18     
  Branches     4353     4361       +8     
==========================================
+ Hits        12020    12029       +9     
+ Misses       8287     8286       -1     
- Partials     1041     1051      +10     
Impacted Files Coverage Δ
src/emulator/functionsEmulator.ts 8.12% <0.00%> (+0.02%) ⬆️
src/emulator/functionsRuntimeWorker.ts 61.41% <64.28%> (-3.23%) ⬇️
src/emulator/emulatorLogger.ts 33.07% <0.00%> (+1.57%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@taeold taeold marked this pull request as ready for review January 25, 2023 20:12
@taeold taeold changed the base branch from cf3_python to master January 25, 2023 21:30
@taeold taeold force-pushed the dl_emulator_timeout branch from e1820fb to d1a42b2 Compare January 25, 2023 21:34
@taeold taeold force-pushed the dl_emulator_timeout branch from d1a42b2 to 02ef09d Compare January 30, 2023 21:57
this.id = uuid.v4();
this.key = key;
this.triggerKey = triggerId || "~free~";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make "~free" a const?

@taeold
Copy link
Contributor Author

taeold commented Jan 31, 2023

⏳ This pull request is set to merge as part of a Graphite merge job
Stack job ID: aDBFOYKNmnzR1pnl7vJM.
See details on graphite.dev

@taeold taeold force-pushed the dl_emulator_timeout branch from 02ef09d to 5dafafe Compare January 31, 2023 18:05
@taeold taeold force-pushed the dl_emulator_timeout branch from 5dafafe to 7a3e720 Compare January 31, 2023 22:56
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.

4 participants