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

Ensure image buffers passed to the worker spun to generate a PDF request is transferrable #3

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

eokoneyo
Copy link

Summary

Modify implementation to add image to pdf creates new transferrable image buffer, so that buffers that get sent to reporting worker will always get detached and free up memory on the main thread.

Informed from https://github.com/elastic/kibana/pull/205983/files#r1929384942

}
}

myPort.postMessage(generatePdfRequest, this.transferList);
Copy link
Author

Choose a reason for hiding this comment

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

Since we ensure the buffers added to this list are transferable, it should be fine to simply pass them along. I wonder if after doing this we still need the former safe guard especially that we also have tests in place

@eokoneyo eokoneyo changed the title Ensure image buffers to the worker spun to generate a PDF request is transferrable Ensure image buffers passed to the worker spun to generate a PDF request is transferrable Jan 27, 2025
Copy link
Owner

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

Thank you!

@jbudz jbudz merged commit a00e0d6 into jbudz:node-22 Jan 28, 2025
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.

2 participants