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

SNOW-1255447: Fix leaked connection due to error response #719

Merged
merged 6 commits into from
Mar 21, 2024

Conversation

sfc-gh-tzhang
Copy link
Contributor

We're leaking HTTP connection when we get an error response from server, and if the client keeps retrying, we will run out connections from the connection pool. This PR contains the change to consume the HTTP response even under error case which will release the connection internally.

@sfc-gh-tzhang sfc-gh-tzhang requested review from a team as code owners March 21, 2024 01:07
Copy link
Collaborator

@sfc-gh-japatel sfc-gh-japatel left a comment

Choose a reason for hiding this comment

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

Nice catch! Lgtm!

@@ -263,11 +266,12 @@ private static HttpResponse handleExceptionalStatus(
requestBuilder.addToken(request);
response = httpClient.execute(request);
if (!isStatusOK(response.getStatusLine())) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the if-condition needed here? It looks like we are already inside the same condition (line 247).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, see line 262-265, we refresh the token and retry the request again

@sfc-gh-tzhang sfc-gh-tzhang merged commit b4e04b2 into master Mar 21, 2024
14 checks passed
@sfc-gh-tzhang sfc-gh-tzhang deleted the tzhang-si-threads branch March 21, 2024 21:46
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