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

🎁 Populate nwritten_out when errors occur in config-store::get or dictionary::get #389

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

elliottt
Copy link
Contributor

@elliottt elliottt commented Jun 18, 2024

The wiggle representation of a function that returns Result<u32, FastlyStatus> and one that takes a u32 outparam as its last argument and returns Result<(), FastlyStatus> are the same, which means that we can support communicating the length needed to resolve a FastlyStatus::BufferLen error without changing the abi of fastly_config_store::get or fastly_dictionary::get.

This PR makes this change to both fastly_config_store::get and fastly_dictionary::get, allowing SDKs to better adapt when buffer-length errors occur.

@elliottt elliottt force-pushed the trevor/config-store-written-out branch 3 times, most recently from e67f30f to cec5670 Compare June 18, 2024 21:03
@elliottt elliottt force-pushed the trevor/config-store-written-out branch from cec5670 to 305bb3d Compare June 18, 2024 21:07
@elliottt elliottt marked this pull request as ready for review June 18, 2024 21:16
@elliottt elliottt requested a review from acw June 18, 2024 21:16
@elliottt elliottt changed the title Rework fastly_config_store#get to always return the buffer length 🎁 Populate nwritten_out when errors occur in config-store::get or dictionary::get Jun 18, 2024
cee-dub
cee-dub previously approved these changes Jun 19, 2024
Copy link
Contributor

@cee-dub cee-dub left a comment

Choose a reason for hiding this comment

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

LGTM! I'm pretty new to reading Rust code, so if you want another reviewer, please pull someone in.

@acfoltzer acfoltzer self-requested a review June 20, 2024 18:17
Copy link

@athomason athomason left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@acfoltzer acfoltzer left a comment

Choose a reason for hiding this comment

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

Looks good, and matches the pending witx changes of the platform.

@elliottt elliottt merged commit 58c2f53 into main Jun 24, 2024
7 checks passed
@elliottt elliottt deleted the trevor/config-store-written-out branch June 24, 2024 16:26
GeeWee pushed a commit to GeeWee/Viceroy that referenced this pull request Jul 25, 2024
…tionary::get (fastly#389)

The wiggle representation of a function that returns Result<u32, FastlyStatus> and one that takes a u32 outparam as its last argument and returns Result<(), FastlyStatus> are the same, which means that we can support communicating the length needed to resolve a FastlyStatus::BufferLen error without changing the abi of fastly_config_store::get or fastly_dictionary::get.

This PR makes this change to both fastly_config_store::get and fastly_dictionary::get, allowing SDKs to better adapt when buffer-length errors occur.
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.

5 participants