mailtoboggavarapu-coder opened a new pull request, #19965:
URL: https://github.com/apache/hudi/pull/19965
### Describe the issue this Pull Request addresses
`SchemaRegistryProvider.fetchSchemaUsingLegacyMethod()` reads the HTTP
response via `getStream(connection)` (which calls
`HttpURLConnection.getInputStream()`) and passes it directly to
`mapper.readTree()`. The `InputStream` is never explicitly closed, so the
underlying TCP socket stays open until GC runs — this can exhaust file
descriptors under sustained Kafka ingestion load.
### Summary and Changelog
Wrapped the `getStream(connection)` call in a try-with-resources block:
```java
// before
JsonNode node = mapper.readTree(getStream(connection));
return node.get("schema").asText();
// after
try (InputStream stream = getStream(connection)) {
JsonNode node = mapper.readTree(stream);
return node.get("schema").asText();
}
```
`InputStream` is already imported in this file — no new imports needed. No
behavior change; purely a resource-management fix.
### How was this patch tested?
Existing unit tests cover this code path. No new logic was introduced.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]