{"record":{"id":"e3567fa20549e466","repo":"eclipse-vertx/vert.x","slug":"expecting-a-stripescount-that-is-larger-than-0-e3567f","errorCode":null,"errorMessage":"Expecting a stripesCount that is larger than 0","messagePattern":"Expecting a stripesCount that is larger than 0","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java21/io/vertx/core/json/jackson/v3/HybridJacksonPool.java","lineNumber":86,"sourceCode":"    }\n    // the native thread pool is based on ThreadLocal, so it doesn't have anything to do on release\n  }\n\n  public static class StripedLockFreePool implements RecyclerPool<BufferRecycler> {\n\n    private static final int CACHE_LINE_SHIFT = 4;\n\n    private static final int CACHE_LINE_PADDING = 1 << CACHE_LINE_SHIFT;\n\n    private final XorShiftThreadProbe threadProbe;\n\n    private final AtomicReferenceArray<Node> topStacks;\n\n    private final int stripesCount;\n\n    public StripedLockFreePool(int stripesCount) {\n      if (stripesCount <= 0) {\n        throw new IllegalArgumentException(\"Expecting a stripesCount that is larger than 0\");\n      }\n\n      this.stripesCount = stripesCount;\n      int size = roundToPowerOfTwo(stripesCount);\n      this.topStacks = new AtomicReferenceArray<>(size * CACHE_LINE_PADDING);\n\n      int mask = (size - 1) << CACHE_LINE_SHIFT;\n      this.threadProbe = new XorShiftThreadProbe(mask);\n    }\n\n    public int size() {\n      return stackSizes().sum();\n    }\n\n    public int[] stackStats() {\n      return stackSizes().toArray();\n    }\n","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java21/io/vertx/core/json/jackson/v3/HybridJacksonPool.java#L68-L104","documentation":"HybridJacksonPool.StripedLockFreePool is the internal striped lock-free pool used by the Vert.x Jackson pool. Its constructor validates that stripesCount is > 0 and throws IllegalArgumentException('Expecting a stripesCount that is larger than 0') otherwise. This is an internal invariant check; users hit it only through misconfiguration of the pool, typically via system properties.","triggerScenarios":"Constructing StripedLockFreePool with 0 or a negative value; setting the Vert.x Jackson pool configuration property (e.g. vertx.jacksonPool.size or the hybrid pool stripe count) to 0/negative or to a value that resolves to <= 0 at init.","commonSituations":"Tuning JSON parser pool size via -D properties in containers/K8s where the value came from an unset/zero env var ('0' string); copy-pasted tuning config from a blog; startup code configuring the pool before properties load.","solutions":["Check JVM system properties configuring the Jackson pool; set the size to a positive value (e.g. 16 or 2*cores).","If sourcing from an env var, guard against unset/zero: use a default when the variable is absent or <= 0.","Do not instantiate StripedLockFreePool directly — it is internal; configure via supported Vert.x options/properties only.","Remove the invalid tuning property entirely to fall back to the default pool sizing."],"exampleFix":"// before\n-Dvertx.jsonPool.size=${POOL_SIZE}  # POOL_SIZE unset -> 0\n// after\n-Dvertx.jsonPool.size=${POOL_SIZE:-16}","handlingStrategy":"validation","validationCode":"int poolSize = Integer.getInteger(\"vertx.jacksonPool.size\", Runtime.getRuntime().availableProcessors() * 2);\nif (poolSize <= 0) {\n  throw new IllegalStateException(\"vertx.jacksonPool.size must be > 0, got \" + poolSize);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default any pool-size system property to a positive value; never pass raw env vars.","Validate startup configuration before Vert.x initializes its Jackson pool.","Treat pool tuning properties as integers > 0 and document valid ranges."],"tags":["configuration","pool","jackson","internal"],"backgroundTag":"invalid-config-value","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}