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

Don't retransmit a PipeDuplexRequestBody #2791

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

swankjesse
Copy link
Member

No description provided.

Copy link
Member

@carranca carranca left a comment

Choose a reason for hiding this comment

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

Nice! Love the inline explanations too. Thanks for looking into this!

// Give the mock server invalid actions (SendCompleted with no response message), which will
// cause it to reset the socket connection.
mockService.enqueue(ReceiveCall("/routeguide.RouteGuide/RecordRoute"))
mockService.enqueue(SendCompleted)
Copy link
Member

Choose a reason for hiding this comment

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

A-ha, nice and cleaner than the initial attempts.

// Confirm we get an IOException from the broken connection and not an IllegalStateException
// from incorrectly attempting to recover.
val (requestChannel, deferredResponse) = routeGuideService.RecordRoute().executeBlocking()
val e = assertFailsWith<IOException> {
Copy link
Member

Choose a reason for hiding this comment

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

Did you confirm that without your fix this was producing IllegalStateException?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes!

@@ -39,4 +39,7 @@ internal class PipeDuplexRequestBody(
}

override fun isDuplex() = true

/** [Pipe.fold] can only be called once. */
override fun isOneShot() = true
Copy link
Member

Choose a reason for hiding this comment

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

good find

@oldergod oldergod merged commit e78ebdf into master Jan 22, 2024
7 checks passed
@oldergod oldergod deleted the jwilson.0119.pipe_already_folded branch January 22, 2024 12:10
@oldergod oldergod mentioned this pull request Jan 22, 2024
@rndhacker
Copy link

When is this change shipping to a new version? @oldergod

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.

None yet

4 participants