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

Add closing functionality to Viceroy for Handles #65

Merged
merged 1 commit into from
Aug 23, 2021

Conversation

mgattozzi
Copy link
Contributor

This adds the ability for Viceroy to handle closing handles for
Response, Request, Body, and StreamingBody Handle types via the close
host calls that were added to the public ABI and internally for C@E
which has rolled out to the fleet. While this does not include any SDK
updates for the tests, I've tested this out with the new version of the
Rust SDK to make sure things work out correctly which helped find a bug
or with how I implemented it with Viceroy. With this we can still work
with old versions of the SDK and handle the new SDK as well.

Closes #64

@mgattozzi mgattozzi requested a review from cratelyn August 23, 2021 17:52
Copy link
Contributor

@cratelyn cratelyn left a comment

Choose a reason for hiding this comment

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

very tiny changes requested, the core of this all seems good to me!

lib/src/wiggle_abi/req_impl.rs Outdated Show resolved Hide resolved
lib/src/wiggle_abi/resp_impl.rs Outdated Show resolved Hide resolved
@@ -252,6 +252,23 @@ impl Session {
.ok_or(HandleError::InvalidBodyHandle(handle))
}

/// Drop a [`Body`][body] from the [`Session`], given its [`BodyHandle`][handle].
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we can use intradoc links here 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right I had just copied from what we had before let me fix that up

@mgattozzi mgattozzi requested a review from cratelyn August 23, 2021 18:33
Comment on lines 262 to 263
// Unlike take_body we don't want to call into_body
// as this will cause an InvalidBodyHandle error
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, i have one more nitpick.

could you reword this comment slightly? i was confused for a moment why this would cause an invalid handle error; upon further reading i've realized that you meant this function would return said error because BodyVariant::into_body will return None in the streaming case

@mgattozzi mgattozzi requested a review from cratelyn August 23, 2021 18:46
@mgattozzi
Copy link
Contributor Author

No worries @cratelyn should be good now

cratelyn
cratelyn previously approved these changes Aug 23, 2021
Copy link
Contributor

@cratelyn cratelyn 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!!

This adds the ability for Viceroy to handle closing handles for
Response, Request, Body, and StreamingBody Handle types via the close
host calls that were added to the public ABI and internally for C@E
which has rolled out to the fleet. While this does not include any SDK
updates for the tests, I've tested this out with the new version of the
Rust SDK to make sure things work out correctly which helped find a bug
or with how I implemented it with Viceroy. With this we can still work
with old versions of the SDK and handle the new SDK as well.

Closes #64
@mgattozzi mgattozzi requested a review from cratelyn August 23, 2021 19:14
@mgattozzi
Copy link
Contributor Author

I did a full squash so I can merge with just the one commit @cratelyn and so will need a ♻️ ✔️

Copy link
Contributor

@cratelyn cratelyn left a comment

Choose a reason for hiding this comment

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

a pr so nice i approved it twice!

@mgattozzi mgattozzi merged commit 4c69e96 into main Aug 23, 2021
@mgattozzi mgattozzi deleted the mgattozzi/closing-the-handles branch August 23, 2021 20:31
@mgattozzi
Copy link
Contributor Author

❤️ Thanks @cratelyn

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.

Add close functionality to RequestHandle/ResponseHandle and update BodyHandle/StreamingBodyHandle
2 participants