FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: wrap GZIPInputStream for connection reuse by codyoss · Pull Request #840 · googleapis/google-http-java-client · GitHub

feat: wrap GZIPInputStream for connection reuse - #840

Merged
codyoss merged 3 commits into
googleapis:masterfrom
codyoss:chuncked-keepalive
Oct 18, 2019
Merged

feat: wrap GZIPInputStream for connection reuse#840
codyoss merged 3 commits into
googleapis:masterfrom
codyoss:chuncked-keepalive

Conversation

codyoss commented Oct 14, 2019

Copy link
Copy Markdown
Member

If a connection is closed and there are some bytes that have not
been read that connection can't be reused. Now GZIPInputStream
will have all of its bytes read on close automatically to promote
connection reuse.

Cherry-picked: #749
Fixes: #367

chingor13 and others added 2 commits October 14, 2019 09:52
If a connection is closed and there are some bytes that have not
been read that connection can't be reused. Now GZIPInputStream
will have all of its bytes read on close automatically to promote
connection reuse.

Cherry-picked: googleapis#749
Fixes: googleapis#367
codyoss requested a review from a team October 14, 2019 18:33
googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 14, 2019

codyoss commented Oct 14, 2019
edited
Loading

Copy link
Copy Markdown
Member Author

Noticed that #749 had not been updated in a while so I cherry picked and fixed the PR comments.


/**
* This class in meant to wrap an {@link InputStream} so that all bytes in the steam are read and
* discarded on {@link InputStream#close()}. This ensures that the underlying connection has the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What if the stream never ends?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That is a very good question. I am not sure.

public void close() throws IOException {
if (!closed && inputStream != null) {
try {
ByteStreams.exhaust(this);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I wonder if we could have an infinite loop here. See internal discussion.

codyoss commented Oct 17, 2019

Copy link
Copy Markdown
Member Author

@elharo I fixed all of the comments. Do you still have reservations around a possible infinite stream? If so, any thought on how we should move forward with this?(Maybe we just don't if we think the infinite stream is too big of a risk as this feature requires exhausting all of the extra bytes for it to work.)

elharo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

given how this is used and that it's non-public the infinite steam issue probably won't come up

codyoss merged commit 087a428 into googleapis:master Oct 18, 2019
codyoss deleted the chuncked-keepalive branch October 18, 2019 17:36
clundin25 pushed a commit to clundin25/google-http-java-client that referenced this pull request Aug 11, 2022
…-sdk to v2.0.3 (googleapis#840)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.appengine:appengine-api-1.0-sdk](https://togithub.com/GoogleCloudPlatform/appengine-java-standard) | `2.0.2` -> `2.0.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.appengine:appengine-api-1.0-sdk/2.0.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.appengine:appengine-api-1.0-sdk/2.0.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.appengine:appengine-api-1.0-sdk/2.0.3/compatibility-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.appengine:appengine-api-1.0-sdk/2.0.3/confidence-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>GoogleCloudPlatform/appengine-java-standard</summary>

### [`v2.0.3`](https://togithub.com/GoogleCloudPlatform/appengine-java-standard/releases/v2.0.3)

Release 2.0.3 from github open source code.

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-auth-library-java).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chunked encoding + GZIP prevents keep-alive

4 participants


Back | FazBrowse Home | New Git URL