github-advanced-security[bot] commented on code in PR #19032:
URL: https://github.com/apache/druid/pull/19032#discussion_r2828469008
##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/IngestionSmokeTest.java:
##########
@@ -359,6 +385,24 @@
Assertions.assertTrue(logs.contains(expectedLogLine), "Actual logs are: "
+ logs);
}
+ private void downloadTaskLogForDebugging(String taskId) throws Exception
+ {
+ final Optional<InputStream> streamOptional =
+ cluster.callApi().waitForResult(
+ () -> overlord.bindings()
+ .getInstance(TaskLogStreamer.class)
+ .streamTaskLog(taskId, 0),
+ Optional::isPresent
+ ).go();
+
+ Assertions.assertTrue(streamOptional.isPresent());
+
+ IOUtils.copy(
+ streamOptional.get(),
+ new FileOutputStream(new File("tasklogs", taskId))
Review Comment:
## Potential output resource leak
This FileOutputStream is not always closed on method exit.
[Show more
details](https://github.com/apache/druid/security/code-scanning/10818)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]