Skip to content

Fix poor resource management code (fixes #179)#181

Merged
domesticmouse merged 1 commit intogooglemaps:masterfrom
ben-manes:master
Sep 27, 2016
Merged

Fix poor resource management code (fixes #179)#181
domesticmouse merged 1 commit intogooglemaps:masterfrom
ben-manes:master

Conversation

@ben-manes
Copy link
Copy Markdown
Contributor

When the response contents are copied the input stream was not being
closed. This might appear correct for a one-off tests due to new
connections being established. Unfortunately it eventually consumes
the entire pool with stuck connections, resulting in no new requests
being sent. Cancelling the request isn't enough since the connection
is still stuck in a bad state.

The simple solution is to close the InputStream, but since OkHttp has
a method to do this we'll just delete this bad code entirely.

When the response contents are copied the input stream was not being
closed. This might appear correct for a one-off tests due to new
connections being established. Unfortunately it eventually consumes
the entire pool with stuck connections, resulting in no new requests
being sent. Cancelling the request isn't enough since the connection
is still stuck in a bad state.

The simple solution is to close the InputStream, but since OkHttp has
a method to do this we'll just delete this bad code entirely.
@ben-manes
Copy link
Copy Markdown
Contributor Author

This is available on jitpack.io using the coordinates
com.github.ben-manes:google-maps-services-java:cc3530ad22

Copy link
Copy Markdown
Contributor

@domesticmouse domesticmouse left a comment

Choose a reason for hiding this comment

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

LGTM

@domesticmouse domesticmouse merged commit 0a7a670 into googlemaps:master Sep 27, 2016
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.

2 participants