{"record":{"id":"04efdb5c2fce0436","repo":"eclipse-vertx/vert.x","slug":"internalblockingpoolsize-must-be-0","errorCode":null,"errorMessage":"internalBlockingPoolSize must be > 0","messagePattern":"internalBlockingPoolSize must be > 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/VertxOptions.java","lineNumber":354,"sourceCode":"   * Get the value of internal blocking pool size.\n   * <p>\n   * Vert.x maintains a pool for internal blocking operations\n   *\n   * @return the value of internal blocking pool size\n   */\n  public int getInternalBlockingPoolSize() {\n    return internalBlockingPoolSize;\n  }\n\n  /**\n   * Set the value of internal blocking pool size\n   *\n   * @param internalBlockingPoolSize the maximumn number of threads in the internal blocking pool\n   * @return a reference to this, so the API can be used fluently\n   */\n  public VertxOptions setInternalBlockingPoolSize(int internalBlockingPoolSize) {\n    if (internalBlockingPoolSize < 1) {\n      throw new IllegalArgumentException(\"internalBlockingPoolSize must be > 0\");\n    }\n    this.internalBlockingPoolSize = internalBlockingPoolSize;\n    return this;\n  }\n\n  /**\n   * Will HA be enabled on the Vert.x instance?\n   *\n   * @return true if HA enabled, false otherwise\n   */\n  public boolean isHAEnabled() {\n    return haEnabled;\n  }\n\n  /**\n   * Set whether HA will be enabled on the Vert.x instance.\n   *\n   * @param haEnabled true if enabled, false if not.","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/VertxOptions.java#L336-L372","documentation":"VertxOptions.setInternalBlockingPoolSize throws IllegalArgumentException if internalBlockingPoolSize < 1. The internal blocking pool executes Vert.x's own blocking operations (e.g. filesystem access); a pool size of zero or negative would leave no threads to serve these operations. Vert.x validates at set-time so the failure surfaces at configuration, not during runtime I/O.","triggerScenarios":"new VertxOptions().setInternalBlockingPoolSize(0) or negative; VertxOptions.fromJson with \"internalBlockingPoolSize\" <= 0 (e.g. an env-driven config resolving to 0).","commonSituations":"Sizing the pool from a CPU-count or env-var expression that evaluates to 0 (unset env parsed as 0); copying a config template with a placeholder 0; confusing this pool with the user worker pool and passing a pool-size of 0 to disable it.","solutions":["Pass a positive size, e.g. setInternalBlockingPoolSize(20) (the default).","Fix the config source so the value resolves to >= 1 (e.g. default unset env vars to 20).","Clamp before setting: options.setInternalBlockingPoolSize(Math.max(1, configured))."],"exampleFix":"// before\nopts.setInternalBlockingPoolSize(Integer.parseInt(System.getenv(\"IBP_SIZE\")));\n// after\nint n = Integer.parseInt(System.getenv().getOrDefault(\"IBP_SIZE\", \"20\"));\nopts.setInternalBlockingPoolSize(Math.max(1, n));","handlingStrategy":"validation","validationCode":"int size = configured == null ? 20 : configured;\nif (size < 1) size = 20; // or fail with a clear message\noptions.setInternalBlockingPoolSize(size);","typeGuard":null,"tryCatchPattern":"try {\n  options.setInternalBlockingPoolSize(size);\n} catch (IllegalArgumentException e) {\n  throw new IllegalStateException(\"internalBlockingPoolSize must be >= 1, got \" + size, e);\n}","preventionTips":["Never parse env vars directly into pool sizes without a fallback default","Clamp with Math.max(1, value) when the value is computed","Document that 0 cannot be used to 'disable' the internal pool"],"tags":["vertx","configuration","thread-pool","options-validation"],"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-14T00:17:10.932Z"}