[jira] [Created] (FLINK-6530) Unclosed Response in DatadogHttpClient#validateApiKey()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-6530) Unclosed Response in DatadogHttpClient#validateApiKey()

Shang Yuanchun (Jira)
Ted Yu created FLINK-6530:
-----------------------------

             Summary: Unclosed Response in DatadogHttpClient#validateApiKey()
                 Key: FLINK-6530
                 URL: https://issues.apache.org/jira/browse/FLINK-6530
             Project: Flink
          Issue Type: Bug
            Reporter: Ted Yu
            Priority: Minor


Here is related code:
{code}
    try {
      Response response = client.newCall(r).execute();
      if (!response.isSuccessful()) {
        throw new IllegalArgumentException(
          String.format("API key: %s is invalid", apiKey));
      }
    } catch(IOException e) {
      throw new IllegalStateException("Failed contacting Datadog to validate API key", e);
{code}
If execute() throws exception, the Response instance would be left unclosed.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)