-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
I am trying to track down a file descriptor leak, which so far empirically points to the getstream client as the only major infra change on those instances. I haven't identified directly, so am scanning over the code for possible causes.
One small nit is that this only closes the response if buildResponse does not fail. That can throw an IAE, among others. For peace of mind, it would be better to wrap all logic with a try-with-resources to ensure that the response is closed, rather than delay it and possibly leak, e.g. try (response) { ... }
stream-java/src/main/java/io/getstream/core/http/OKHTTPClientAdapter.java
Lines 105 to 113 in 320e291
| public void onResponse(Call call, okhttp3.Response response) { | |
| io.getstream.core.http.Response httpResponse = buildResponse(response); | |
| try (InputStream ignored = httpResponse.getBody()) { | |
| result.complete(httpResponse); | |
| } catch (Exception e) { | |
| result.completeExceptionally(e); | |
| } finally { | |
| response.body().close(); | |
| } |
Metadata
Metadata
Assignees
Labels
No labels