-
Notifications
You must be signed in to change notification settings - Fork 51
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
Conversation
There was a problem hiding this 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())) { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
…ingest-java into tzhang-si-threads
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.