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

Pass only the minimum set of fields needed to resolvers #12

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

zkayser
Copy link
Contributor

@zkayser zkayser commented Nov 17, 2023

This PR makes a modification to non-batched field resolvers (as well as single-field batch resolvers) to only pass the minimum set of data needed to resolver functions.

Why?

Pacer should limit the set of fields passed to all resolvers as best practice. Pacer does not and cannot know whether or not the value returned from a resolver function will stick around in a long-lived stateful process, and if the value passed into the resolver function is just added to or expanded upon, it is possible that passing the entire workflow struct into any resolver can lead to accidental exponential and/or geometric growth in memory usage.

Copy link
Contributor

@codeadict codeadict left a comment

Choose a reason for hiding this comment

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

Is there any way to add a test for this?

@zkayser
Copy link
Contributor Author

zkayser commented Nov 17, 2023

Is there any way to add a test for this?

Just added in 553d963

@zkayser zkayser merged commit db9b4fe into main Nov 17, 2023
1 check passed
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