{"record":{"id":"f7fe684fa98191e3","repo":"openzipkin/zipkin","slug":"maxconnections-0","errorCode":null,"errorMessage":"maxConnections <= 0","messagePattern":"maxConnections <= 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java","lineNumber":117,"sourceCode":"  public B contactPoints(String contactPoints) {\n    if (contactPoints == null) throw new NullPointerException(\"contactPoints == null\");\n    this.contactPoints = contactPoints;\n    return (B) this;\n  }\n\n  /**\n   * Name of the datacenter that will be considered \"local\" for latency load balancing. When unset,\n   * load-balancing is round-robin.\n   */\n  public B localDc(String localDc) {\n    if (localDc == null) throw new NullPointerException(\"localDc == null\");\n    this.localDc = localDc;\n    return (B) this;\n  }\n\n  /** Max pooled connections per datacenter-local host. Defaults to 8 */\n  public B maxConnections(int maxConnections) {\n    if (maxConnections <= 0) throw new IllegalArgumentException(\"maxConnections <= 0\");\n    this.poolLocalSize = maxConnections;\n    return (B) this;\n  }\n\n  /** Will throw an exception on startup if authentication fails. No default. */\n  public B username(@Nullable String username) {\n    this.username = username;\n    return (B) this;\n  }\n\n  /** Will throw an exception on startup if authentication fails. No default. */\n  public B password(@Nullable String password) {\n    this.password = password;\n    return (B) this;\n  }\n\n  /** Use ssl for connection. Defaults to false. */\n  public B useSsl(boolean useSsl) {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java#L99-L135","documentation":"CassandraStorageBuilder.maxConnections(int) throws IllegalArgumentException ('maxConnections <= 0') when a non-positive pool size is configured. This is the max pooled connections per datacenter-local host (default 8); zero or negative pools cannot serve any request, so the builder rejects the value immediately.","triggerScenarios":"Calling maxConnections(0) or a negative value, or binding an unset optional property (zipkin.storage.cassandra.max-connections) that unboxes to int 0.","commonSituations":"Property omitted in config and defaulted to 0 by a mapping layer; operators tuning pool size down for memory and overshooting; integer truncation of a fractional computed value to 0.","solutions":["Set a positive pool size, e.g. maxConnections(8) (the default)","Fix property mapping so unset values fall back to 8 instead of 0","For low-throughput setups use a small positive value like 2 rather than 0"],"exampleFix":"# before\nzipkin.storage.cassandra.max-connections=0\n\n# after\nzipkin.storage.cassandra.max-connections=8","handlingStrategy":"validation","validationCode":"int maxConnections = config.getInt(\"maxConnections\", 8);\nif (maxConnections <= 0) throw new IllegalArgumentException(\"maxConnections must be positive\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default pool-size settings to the documented default (8), never 0","Reject zero values for capacity settings during config load"],"tags":["zipkin","cassandra","connection-pool","configuration","validation"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}