{"record":{"id":"02f3bf6328f962f5","repo":"openzipkin/zipkin","slug":"concurrency-1-02f3bf","errorCode":null,"errorMessage":"concurrency < 1","messagePattern":"concurrency < 1","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"zipkin-collector/pulsar/src/main/java/zipkin2/collector/pulsar/PulsarCollector.java","lineNumber":64,"sourceCode":"      this.metrics = metrics.forTransport(\"pulsar\");\n      this.delegate.metrics(this.metrics);\n      return this;\n    }\n\n    @Override\n    public Builder sampler(CollectorSampler sampler) {\n      this.delegate.sampler(sampler);\n      return this;\n    }\n\n    @Override\n    public PulsarCollector build() {\n      return new PulsarCollector(this);\n    }\n\n    /** Count of concurrent message consumers on the topic. Defaults to 1. */\n    public Builder concurrency(Integer concurrency) {\n      if (concurrency < 1) throw new IllegalArgumentException(\"concurrency < 1\");\n      this.concurrency = concurrency;\n      return this;\n    }\n\n    /** Queue zipkin spans will be consumed from. Defaults to \"zipkin\". */\n    public Builder topic(String topic) {\n      if (StringUtils.isNullOrEmpty(topic)) throw new NullPointerException(\"topic is null or empty\");\n      this.topic = topic;\n      return this;\n    }\n\n    /** The service URL for the Pulsar client ex. pulsar://my-broker:6650. No default. */\n    public Builder serviceUrl(String serviceUrl) {\n      if (StringUtils.isNullOrEmpty(serviceUrl)) throw new NullPointerException(\"serviceUrl is null or empty\");\n      clientProps.put(\"serviceUrl\", serviceUrl);\n      return this;\n    }\n","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-collector/pulsar/src/main/java/zipkin2/collector/pulsar/PulsarCollector.java#L46-L82","documentation":"PulsarCollector.Builder.concurrency(Integer) throws IllegalArgumentException when the value is less than 1. Concurrency controls how many message consumers subscribe to the topic; zero or negative consumers is a misconfiguration. Note the parameter is boxed Integer, so passing null would instead cause an NPE during unboxing before this check.","triggerScenarios":"Calling .concurrency(0) or .concurrency(-1), or computing concurrency from a config value/cpu formula that can evaluate to 0 (e.g. a percentage of cores rounded down).","commonSituations":"Sizing concurrency from environment variables (CONCURRENCY=0 in a staging config) or from a dynamic formula that returns 0 on small machines.","solutions":["Set concurrency to at least 1 (the default), e.g. .concurrency(Math.max(1, desired))","Fix the source of the value: validate the env var / config key at startup","If concurrency is optional, skip the call to keep the default of 1"],"exampleFix":"// before\nbuilder.concurrency(Integer.getInteger(\"pulsar.concurrency\", 0));\n\n// after\nbuilder.concurrency(Math.max(1, Integer.getInteger(\"pulsar.concurrency\", 1)));","handlingStrategy":"validation","validationCode":"int concurrency = Integer.parseInt(props.getProperty(\"pulsar.concurrency\", \"1\"));\nif (concurrency < 1) throw new IllegalStateException(\"pulsar.concurrency must be >= 1\");\nbuilder.concurrency(concurrency);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp dynamic sizing: Math.max(1, value)","Validate numeric config at load time with a clear error naming the key"],"tags":["pulsar","zipkin","builder","validation","concurrency"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}