-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix race condition in trigger disable #2858
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@yuchenshi this one is ready to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One question: What happens if the functions code is hot-reloaded while trigger is disabled? Would it cause a race condition somehow and re-enable the functions early?
@yuchenshi hot reload would not re-enable existing functions because the generation number won't be increased. |
Description
Fixes #2857
We give all background triggers a "generation number" which allows us to disable triggers inside the functions emulator and then when incoming calls try to run those triggers, even after a large delay, we can ignore it.
Scenarios Tested
functions/index.js
functions/test.js
Logs:
Sample Commands
N/A