apache/pulsar · error · IllegalArgumentException
Per instance CPU requested, %s, for function is less than th
Error message
Per instance CPU requested, %s, for function is less than the minimum required, %s
What it means
validateMinResourcesRequired rejects functions whose requested CPU is below the worker-configured minimum. When functionDetails.resources.cpu < functionInstanceMinResources.cpu, an IllegalArgumentException reports both values.
Source
Thrown at pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeFactory.java:453
.attr("newValue", data.get(field.getName()))
.log("Kubernetes Config changed");
field.set(kubernetesRuntimeFactory, data.get(field.getName()));
}
}
}
void validateMinResourcesRequired(FunctionDetails functionDetails) {
if (functionInstanceMinResources != null) {
Double minCpu = functionInstanceMinResources.getCpu();
Long minRam = functionInstanceMinResources.getRam();
if (minCpu != null) {
if (!functionDetails.hasResources()) {
throw new IllegalArgumentException(
String.format("Per instance CPU requested is not specified. "
+ "Must specify CPU requested for function to be at least %s", minCpu));
} else if (functionDetails.getResources().getCpu() < minCpu) {
throw new IllegalArgumentException(
String.format("Per instance CPU requested, %s, "
+ "for function is less than the minimum required, %s",
functionDetails.getResources().getCpu(), minCpu));
}
}
if (minRam != null) {
if (!functionDetails.hasResources()) {
throw new IllegalArgumentException(
String.format("Per instance RAM requested is not specified. "
+ "Must specify RAM requested for function to be at least %s", minRam));
} else if (functionDetails.getResources().getRam() < minRam) {
throw new IllegalArgumentException(
String.format("Per instance RAM requested, %s, "
+ "for function is less than the minimum required, %s",
functionDetails.getResources().getRam(), minRam));
}
}View on GitHub (pinned to 820761864e)
Solutions
- Increase the function's --cpu to at least the configured minimum.
- Request the cluster admin to lower functionInstanceMinResources.cpu if the limit is wrong for your workload.
- Update deployment templates/CI to enforce the minimum at submission time with a clear error.
Example fix
// before --cpu 0.2 // after --cpu 1.0 (assuming min cpu is 1.0)
Defensive patterns
Strategy: validation
Validate before calling
if (minCpu != null && details.getResources().getCpu() < minCpu) {
throw new IllegalArgumentException("cpu " + details.getResources().getCpu() + " < required min " + minCpu);
} Try / catch
try { admin.functions().updateFunction(config); } catch (IllegalArgumentException e) { if (e.getMessage().contains("less than the minimum")) { /* raise cpu or notify admin */ } throw e; } Prevention
- Fetch the worker's admission config and clamp submitted cpu values to it
- Add a CI pre-check comparing requested CPU against cluster minimums
- Keep per-environment resource templates in sync with worker configs
When it happens
Trigger: Submitting/updating a function with --cpu lower than the cluster's functionInstanceMinResources.cpu (admission check path doAdmissionChecks -> validateMinResourcesRequired, line 453).
Common situations: Copy-pasting function configs from a cluster with laxer limits; reducing CPU to cut cost after a policy tightening; environment migration (dev -> prod) where prod enforces minimums.
Related errors
- Per instance CPU requested, %s, for function is greater than
- Per instance CPU requested is not specified. Must specify CP
- Per instance RAM requested, %s, for function is less than th
- Per instance RAM requested, %s, for function is greater than
- Per instance RAM requested is not specified. Must specify RA
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/80673ff55996be27.
Report an issue: GitHub.