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

Stream attachments from file to use in transport #1022

Open
supervacuus opened this issue Jul 31, 2024 · 0 comments
Open

Stream attachments from file to use in transport #1022

supervacuus opened this issue Jul 31, 2024 · 0 comments

Comments

@supervacuus
Copy link
Collaborator

This is a follow-up issue to #1001.

We currently load attachments via sentry__envelope_add_from_path into memory before adding them to the internal envelope structure:

sentry_envelope_item_t *
sentry__envelope_add_from_path(
sentry_envelope_t *envelope, const sentry_path_t *path, const char *type)
{
if (!envelope) {
return NULL;
}
size_t buf_len;
char *buf = sentry__path_read_to_buffer(path, &buf_len);
if (!buf) {
SENTRY_WARNF("failed to read envelope item from \"%" SENTRY_PATH_PRI
"\"",
path->path);
return NULL;
}
// NOTE: function will free `buf` on error
return envelope_add_from_owned_buffer(envelope, buf, buf_len, type);
}

Since #1001 relates to a customer issue where the SDK sent incomplete envelopes due to OOM, we could further reduce the required memory by not loading attachments into memory when constructing the envelope and deferring until the transport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants