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(pkg/sdk): solve memory alignment issues when setting extraction value #75

Merged
merged 3 commits into from
May 19, 2023

Conversation

jasondellaluce
Copy link
Contributor

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area plugin-sdk

What this PR does / why we need it:

Which issue(s) this PR fixes:

When writing res data into a ss_plugin_extract_field, we allocate an array batch that we reuse from request to request. We used to compute the offset of each result "slot" by assuming that each value always had the same size as the union of results, because by supporting only a char pointer and uint64 all values had the same size. This guarantee stopped being true when we introduced ss_plugin_byte_buffer, which now forces us to compute the right result slot offsets depending on the type data size, which is the right thing to do anyways. The framework will expect the result to be a contiguous array of the same data type defines by the result union, so it should be the SDK's responsibility to properly align values like that.

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix(pkg/sdk): solve memory alignment issues when setting extraction value

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

🤯

@poiana
Copy link

poiana commented May 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jasondellaluce, leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [jasondellaluce,leogr]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
Copy link

poiana commented May 19, 2023

LGTM label has been added.

Git tree hash: 0e8997caebb7b38c8c23778acabcc3119f081e7d

@poiana poiana merged commit 7b2cafb into main May 19, 2023
3 checks passed
@poiana poiana deleted the fix/extract-list-values branch May 19, 2023 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants