{"record":{"id":"46b42a8a1c9b5869","repo":"apache/druid","slug":"maxactiveprocessors-d-1","errorCode":null,"errorMessage":"maxActiveProcessors[%d] < 1","messagePattern":"maxActiveProcessors\\[(.+?)\\] < 1","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java","lineNumber":269,"sourceCode":"    this.exec = exec;\n    this.processorDecorator = processorDecorator;\n    this.outputChannelFactory = outputChannelFactory;\n    this.intermediateOutputChannelFactory = intermediateOutputChannelFactory;\n    this.outputFrameType = outputFrameType;\n    this.maxChannelsPerMerger = maxChannelsPerMerger;\n    this.maxActiveProcessors = maxActiveProcessors;\n    this.rowLimit = rowLimit;\n    this.cancellationId = cancellationId;\n    this.superSorterProgressTracker = superSorterProgressTracker;\n    this.removeNullBytes = removeNullBytes;\n    this.combinerFactory = combinerFactory;\n\n    for (int i = 0; i < inputChannels.size(); i++) {\n      inputChannelsToRead.add(i);\n    }\n\n    if (maxActiveProcessors < 1) {\n      throw new IAE(\"maxActiveProcessors[%d] < 1\", maxActiveProcessors);\n    }\n\n    if (maxChannelsPerMerger < 2) {\n      throw new IAE(\"maxChannelsPerMerger[%d] < 2\", maxChannelsPerMerger);\n    }\n\n    if (rowLimit != UNLIMITED && rowLimit <= 0) {\n      throw new IAE(\"rowLimit[%d] must be positive\", rowLimit);\n    }\n  }\n\n  /**\n   * Starts sorting. Can only be called once. Work is performed in the {@link FrameProcessorExecutor} that was\n   * passed to the constructor.\n   *\n   * Returns a future containing partitioned sorted output channels.\n   */\n  public ListenableFuture<OutputChannels> run()","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/frame/processor/SuperSorter.java#L251-L287","documentation":"The SuperSorter constructor validates its concurrency configuration before building the sort pipeline. maxActiveProcessors controls how many FrameProcessors may run concurrently; a value below 1 would stall the sorter (no processor could ever be scheduled), so an IAE is thrown eagerly. This is a fail-fast configuration validation.","triggerScenarios":"Constructing SuperSorter with maxActiveProcessors = 0 or negative — typically from a misconfigured query-time setting such as a server config that sets the frame processor concurrency to 0, or arithmetic that computes the limit as available processors minus something and underflows.","commonSituations":"Druid cluster config with numThreads/maxActiveProcessors set to 0 or negative in runtime.properties; code computing the limit from a quota or CPU count that resolves to 0 in a constrained container; passing the wrong argument position to the constructor.","solutions":["Set maxActiveProcessors to at least 1 (in practice the number of frame processor threads, e.g. druid_processing_numThreads) in the server configuration","Fix the code that computes the limit so it clamps to Math.max(1, computed)","Verify the constructor call site passes arguments in the correct order (processors limit vs maxChannelsPerMerger)"],"exampleFix":"// before\nnew SuperSorter(inputChannels, allowInputReading, maxActiveProcessors = 0, maxChannelsPerMerger, ...);\n// after\nnew SuperSorter(inputChannels, allowInputReading, Math.max(1, configuredMaxActiveProcessors), maxChannelsPerMerger, ...);","handlingStrategy":"validation","validationCode":"if (maxActiveProcessors < 1) { throw new IllegalArgumentException(\"maxActiveProcessors must be >= 1, got \" + maxActiveProcessors); }","typeGuard":null,"tryCatchPattern":"try { sorter = new SuperSorter(...); } catch (IllegalArgumentException e) { if (!e.getMessage().contains(\"maxActiveProcessors\")) throw e; log.error(\"Fix frame processor concurrency config: %s\", e.getMessage()); }","preventionTips":["Validate druid frame-processor concurrency config at startup, before queries arrive","Clamp computed processor limits with Math.max(1, value)","Never hand-write 0 or negative concurrency values in runtime.properties"],"tags":["java","configuration","sorting","fail-fast"],"backgroundTag":"invalid-config-value","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}