{"record":{"id":"7aadd3ff05cbc231","repo":"eclipse-vertx/vert.x","slug":"invalid-window-size-windowsize-7aadd3","errorCode":null,"errorMessage":"Invalid window size: ${windowSize}","messagePattern":"Invalid window size: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/impl/http2/multiplex/Http2MultiplexConnection.java","lineNumber":302,"sourceCode":"  @Override\n  public Http2MultiplexConnection closeHandler(Handler<Void> handler) {\n    return (Http2MultiplexConnection) super.closeHandler(handler);\n  }\n\n  @Override\n  public Http2Settings settings() {\n    return HttpUtils.toVertxSettings(handler.localSettings());\n  }\n\n  @Override\n  public int getWindowSize() {\n    return windowSize;\n  }\n\n  @Override\n  public HttpConnection setWindowSize(int windowSize) {\n    if (windowSize <= 0) {\n      throw new IllegalArgumentException(\"Invalid window size: \" + windowSize);\n    }\n    try {\n      int windowSizeIncrement = windowSize - this.windowSize;\n      handler.incrementWindowsSize(windowSizeIncrement);\n      this.windowSize = windowSize;\n      return this;\n    } catch (Http2Exception e) {\n      throw new VertxException(e);\n    }\n  }\n\n  @Override\n  public Future<Void> updateSettings(HttpSettings settings) {\n    PromiseInternal<Void> promise = context.promise();\n    handler.writeSettings(HttpUtils.fromVertxSettings((Http2Settings) settings), promise);\n    return promise.future();\n  }\n","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/impl/http2/multiplex/Http2MultiplexConnection.java#L284-L320","documentation":"Identical validation to Http2ConnectionImpl: the multiplexed HTTP/2 connection's setWindowSize requires windowSize > 0 because flow-control windows are unsigned positive byte counts. Thrown before applying the increment to the underlying handler.","triggerScenarios":"Calling HttpConnection.setWindowSize(0) or negative on a connection created via Http2MultiplexConnection (HTTP/2 with multiplexing), typically from unvalidated configuration.","commonSituations":"Zero used as 'default/unlimited' in config; signed arithmetic producing negative sizes; differences between stream window settings (which allow different bounds) and connection window.","solutions":["Use a positive value, e.g. setWindowSize(65535) or larger.","Clamp user/config input: windowSize = Math.max(1, configured).","Confirm you are setting the connection window, not the stream window, and that semantics require > 0."],"exampleFix":"// before\nconn.setWindowSize(opts.windowSize()); // 0 possible\n// after\nconn.setWindowSize(Math.max(1, opts.windowSize()));","handlingStrategy":"validation","validationCode":"if (windowSize <= 0) throw new IllegalArgumentException(\"windowSize must be > 0\");","typeGuard":"boolean validWindowSize(int ws) { return ws > 0; }","tryCatchPattern":"try { conn.setWindowSize(ws); } catch (IllegalArgumentException e) { conn.setWindowSize(65535); }","preventionTips":["Clamp configured values with Math.max(1, value)","Set window sizes once at client/server options level","Avoid sentinel zeros in flow-control settings","Test HTTP/2 config parsing with edge values"],"tags":["http2","flow-control","window-size","argument-validation"],"backgroundTag":"invalid-argument-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"}