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

fix: permit waking async interval with unreliable clocks #2551

Merged
merged 1 commit into from Sep 29, 2020

Conversation

mbroadst
Copy link
Member

The logic for waking the AsyncInterruptibleInterval sooner than its interval is dependent on an ability to reliably mark the last call made to the wrapped function. In environments like AWS Lambda where instances can be frozen and later thawed, it's possible for the last call to be in a distant past even though the internal timer has not completed yet. This change ensures that we immediately reschedule in these situations.

NODE-2829

@mbroadst mbroadst changed the title fix: permit waking async interval in unreliable clock environments fix: permit waking async interval in with unreliable clocks Sep 27, 2020
@mbroadst mbroadst changed the title fix: permit waking async interval in with unreliable clocks fix: permit waking async interval with unreliable clocks Sep 27, 2020
The logic for waking the AsyncInterruptibleInterval sooner than its
interval is dependent on an ability to reliably mark the last call
made to the wrapped function. In environments like AWS Lambda where
instances can be frozen and later thawed, it's possible for the
last call to be in a distant past even though the internal timer
has not completed yet. This change ensures that we immediately
reschedule in these situations.

NODE-2829
@mbroadst mbroadst force-pushed the NODE-2829/async-interval-lambda-perf-issue branch from 4da2531 to 786639b Compare September 27, 2020 11:29
Copy link
Contributor

@reggi reggi left a comment

Choose a reason for hiding this comment

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

LGTM 🤯

@mbroadst mbroadst merged commit a2c113f into master Sep 29, 2020
@mbroadst mbroadst deleted the NODE-2829/async-interval-lambda-perf-issue branch September 29, 2020 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants