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

Set a small socket timeout before closing partially consumed responses #1853

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

carterkozak
Copy link
Contributor

This works around a degenerate case in which closure isn't negotiated in a timely manner, and the client consumes far more bytes than desired in SSLSocketInputRecord.deplete.

After this PR

==COMMIT_MSG==
Set a small socket timeout before closing partially consumed responses
==COMMIT_MSG==

This works around a degenerate case in which closure isn't negotiated
in a timely manner, and the client consumes far more bytes than
desired in `SSLSocketInputRecord.deplete`.
@changelog-app
Copy link

changelog-app bot commented Feb 1, 2023

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Set a small socket timeout before closing partially consumed responses

Check the box to generate changelog(s)

  • Generate changelog entry

@carterkozak carterkozak force-pushed the ckozak/terrible_hack_socket_timeout branch from ab754af to 567a855 Compare February 1, 2023 19:14
: "Expected ConnectionEndpointAccess.getConnectionEndpoint "
+ "to extract a ConnectionEndpoint";
if (maybeEndpoint != null) {
maybeEndpoint.setSocketTimeout(Timeout.ONE_MILLISECOND);
Copy link
Contributor

@schlosna schlosna Feb 1, 2023

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so -- that would only skip the single-byte read call, not the skip where most of the time is spent in a loop (with potentially no timeout)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, makes sense so we should expect the skip to timeout after 1ms with no bytes

@sfackler
Copy link
Member

sfackler commented Feb 6, 2023

With some adjustments this could also handle #1814.

@carterkozak
Copy link
Contributor Author

Yep, I'd thought the same thing -- planning to take a look at it after some issues I'm currently digging into.

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.

4 participants