github-advanced-security[bot] commented on code in PR #18851:
URL: https://github.com/apache/druid/pull/18851#discussion_r2629466914
##########
indexing-service/src/test/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunnerTest.java:
##########
@@ -2108,6 +2360,146 @@
};
}
+ /**
+ * Creates a WorkerHolder that tracks the order in which tasks are assigned.
+ */
+ private static WorkerHolder createWorkerHolderWithOrderTracking(
+ ObjectMapper smileMapper,
+ HttpClient httpClient,
+ HttpRemoteTaskRunnerConfig config,
+ ScheduledExecutorService workersSyncExec,
+ WorkerHolder.Listener listener,
+ Worker worker,
+ List<TaskAnnouncement> knownAnnouncements,
+ List<String> taskAssignmentOrder
+ )
+ {
+ return new WorkerHolder(smileMapper, httpClient, config, workersSyncExec,
listener, worker, knownAnnouncements)
+ {
+ private final String workerHost;
+ private final int workerPort;
+ private final LifecycleLock startStopLock = new LifecycleLock();
+
+ {
+ String hostAndPort = worker.getHost();
+ int colonIndex = hostAndPort.indexOf(':');
+ if (colonIndex == -1) {
+ throw new IAE("Invalid host and port: [%s]", colonIndex);
+ }
+ workerHost = hostAndPort.substring(0, colonIndex);
+ workerPort = Integer.parseInt(hostAndPort.substring(colonIndex + 1));
Review Comment:
## Missing catch of NumberFormatException
Potential uncaught 'java.lang.NumberFormatException'.
[Show more
details](https://github.com/apache/druid/security/code-scanning/10603)
--
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]