{"record":{"id":"c60c0ba1daff9a8b","repo":"eclipse-vertx/vert.x","slug":"workerpoolsize-must-be-0","errorCode":null,"errorMessage":"workerPoolSize must be > 0","messagePattern":"workerPoolSize must be > 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"vertx-core/src/main/java/io/vertx/core/VertxOptions.java","lineNumber":236,"sourceCode":"   * Get the maximum number of worker threads to be used by the Vert.x instance.\n   * <p>\n   * Worker threads are used for running blocking code and worker verticles.\n   *\n   * @return the maximum number of worker threads\n   */\n  public int getWorkerPoolSize() {\n    return workerPoolSize;\n  }\n\n  /**\n   * Set the maximum number of worker threads to be used by the Vert.x instance.\n   *\n   * @param workerPoolSize the number of threads\n   * @return a reference to this, so the API can be used fluently\n   */\n  public VertxOptions setWorkerPoolSize(int workerPoolSize) {\n    if (workerPoolSize < 1) {\n      throw new IllegalArgumentException(\"workerPoolSize must be > 0\");\n    }\n    this.workerPoolSize = workerPoolSize;\n    return this;\n  }\n\n  /**\n   * Get the value of blocked thread check period, in {@link VertxOptions#setBlockedThreadCheckIntervalUnit blockedThreadCheckIntervalUnit}.\n   * <p>\n   * This setting determines how often Vert.x will check whether event loop threads are executing for too long.\n   * <p>\n   * The default value of {@link VertxOptions#setBlockedThreadCheckIntervalUnit blockedThreadCheckIntervalUnit} is {@link TimeUnit#MILLISECONDS}.\n   *\n   * @return the value of blocked thread check period, in {@link VertxOptions#setBlockedThreadCheckIntervalUnit blockedThreadCheckIntervalUnit}.\n   */\n  public long getBlockedThreadCheckInterval() {\n    return blockedThreadCheckInterval;\n  }\n","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/VertxOptions.java#L218-L254","documentation":"This is a log warning (not an exception) emitted by JacksonCodec.buildFactory in the Vert.x JSON Jackson (Jackson 3 / Java 21 variant) module. When reading a Jackson read-constraint system property (e.g. vertx.jackson_default_read_max_nesting_depth) via SysProps.getAsInt(), a non-numeric value causes IllegalArgumentException; the codec logs the invalid value and falls back to StreamReadConstraints.DEFAULT_MAX_DEPTH.","triggerScenarios":"Setting a Jackson constraint system property (JACKSON_DEFAULT_READ_MAX_NESTING_DEPTH, and similarly the max doc length property) to a value that cannot be parsed as an integer/long (e.g. empty string or 'abc') before building the JSON codec factory.","commonSituations":"Typos or units accidentally added to JVM options (-Dvertx.jackson_default_read_max_nesting_depth=10x), config templating that interpolates an empty or placeholder value, YAML/properties files quoting values as strings.","solutions":["Remove or correct the system property so it parses as a plain integer (e.g. -Dvertx.jackson_default_read_max_nesting_depth=1000).","If the default constraint (StreamReadConstraints.DEFAULT_MAX_DEPTH) is acceptable, simply unset the property.","Check JVM launch scripts, container env -> -D translation, and start/stop scripts for stale or malformed property values.","Restart the JVM after fixing: system properties are read once when the codec factory is built."],"exampleFix":"// before (JVM args)\n-Dvertx.jackson_default_read_max_nesting_depth=10x\n// after\n-Dvertx.jackson_default_read_max_nesting_depth=1000","handlingStrategy":"validation","validationCode":"String v = System.getProperty(\"vertx.jackson_default_read_max_nesting_depth\", \"\");\nif (!v.isEmpty()) {\n  try { Integer.parseInt(v.trim()); } catch (NumberFormatException e) {\n    throw new IllegalStateException(\"vertx.jackson_default_read_max_nesting_depth must be an integer, got: \" + v);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass plain numeric values for Jackson constraint system properties (no units, no whitespace).","Validate JVM options in startup scripts/CI before launch.","Remember the value is read once at codec factory build time — fix and restart, not just edit configs.","If unsure, omit the property and rely on StreamReadConstraints defaults."],"tags":["json","jackson","system-properties","configuration"],"backgroundTag":"invalid-env-var-value","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}