FrankChen021 commented on code in PR #20579:
URL: https://github.com/apache/druid/pull/20579#discussion_r4272389235
##########
server/src/main/java/org/apache/druid/server/compaction/CompactionSlotManager.java:
##########
@@ -378,7 +369,7 @@ public int computeSlotsRequiredForTask(
public static int computeSlotsRequiredForTask(ClientCompactionTaskQuery task)
{
if (task.isMsq()) {
- return getMaxTaskSlotsForMSQCompactionTask(task.getContext());
+ return
QueryContext.of(task.getContext()).getOrDefault(QueryContextParameters.MAX_NUM_TASKS);
Review Comment:
Hardened in e25310dfcd. Both slot-accounting paths now catch
`BadQueryContextException` and count the task with the default number of slots
(2), logging a warning; regression tests cover `2.5` (default) and `"5"` (5)
through `computeSlotsRequiredForTask(ClientCompactionTaskQuery)`.
For reference, master doesn't handle this either: it reads the value with
`(int) context.getOrDefault("maxNumTasks", 2)`, so any non-`Integer` value
(`2.5`, `"5"`, `5L`, `"abc"`) throws `ClassCastException` and aborts slot
reservation the same way. Values such as `0`, `1` or `-3` are used as is on
master and still are here.
--
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]