-
Notifications
You must be signed in to change notification settings - Fork 200
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(sdk): inflight clients are not cached #5478
Conversation
Reuse the root inflight client across `cloud.Function` handler invocations.
Thanks for opening this pull request! 🎉
|
BenchmarksComparison to Baseline ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜ Within 1.5 standard deviations Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI. Results
Last Updated (UTC) 2024-01-22 07:00 |
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Haven't reviewed yet, but one thing to keep in mind is that cold/warm lambda invocation is an implementation detail. |
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.
I think this is pretty elegant.
I'd like to better doc the behavior an perhaps consider modeling the cold invocation into the could.Function
API.
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Co-authored-by: yoav-steinberg <yoavs@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Thanks for contributing, @eladb! This PR will now be added to the merge queue, or immediately merged if |
Congrats! 🚀 This was released in Wing 0.54.50. |
Following up on #5478 and [@Chriscbr's comment](https://github.com/winglang/wing/pull/5478/files#r1462456582), verify that inflight clients are not shared across two separate instances of a cloud function.
) Following up on #5478 and [@Chriscbr's comment](https://github.com/winglang/wing/pull/5478/files#r1462456582), verify that inflight clients are not shared across two separate instances of a cloud function. ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [x] Docs updated (only required for features) - [x] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
Reuse the handler's inflight client across
cloud.Function
invocations, as long as they are running in the same sandbox.This enables common FaaS optimizations such as caching database connections, etc.
To test this and improve the fidelity of our simulator, I've changed the behavior of
cloud.Function
in the simulator to reuse the function sandbox across invocations and just callhandle()
every time.Checklist
pr/e2e-full
label if this feature requires end-to-end testingBy submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.