{"record":{"id":"265ee94eccc73839","repo":"eclipse-vertx/vert.x","slug":"cannot-have-pipelining-with-no-keep-alive","errorCode":null,"errorMessage":"Cannot have pipelining with no keep alive","messagePattern":"Cannot have pipelining with no keep alive","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/impl/tcp/TcpHttpClientTransport.java","lineNumber":112,"sourceCode":"  private final Duration writeIdleTimeout;\n  private final WebSocketMetrics<?> webSocketMetrics;\n  private final NetClientInternal client;\n\n  public TcpHttpClientTransport(NetClientInternal netClient,\n                                TracingPolicy tracingPolicy,\n                                boolean useDecompression,\n                                boolean logActivity,\n                                ByteBufFormat logFormat,\n                                boolean forceSni,\n                                Http1ClientConfig http1Config,\n                                Http2ClientConfig http2Config,\n                                Duration idleTimeout,\n                                Duration readIdleTimeout,\n                                Duration writeIdleTimeout,\n                                HttpClientMetrics<?, ?> webSocketMetrics) {\n\n    if (http1Config != null && !http1Config.isKeepAlive() && http1Config.isPipelining()) {\n      throw new IllegalStateException(\"Cannot have pipelining with no keep alive\");\n    }\n    this.webSocketMetrics = webSocketMetrics;\n    this.tracingPolicy = tracingPolicy;\n    this.useDecompression = useDecompression;\n    this.logActivity = logActivity;\n    this.logFormat = logFormat;\n    this.forceSni = forceSni;\n    this.http1Config = http1Config;\n    this.http2Config = http2Config;\n    this.idleTimeout = idleTimeout != null ? idleTimeout : Duration.ofMillis(0);\n    this.readIdleTimeout = readIdleTimeout != null ? readIdleTimeout : Duration.ofMillis(0);\n    this.writeIdleTimeout = writeIdleTimeout != null ? writeIdleTimeout : Duration.ofMillis(0);\n    this.client = netClient;\n  }\n\n  public NetClientInternal client() {\n    return client;\n  }","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/impl/tcp/TcpHttpClientTransport.java#L94-L130","documentation":"TcpHttpClientTransport's constructor throws IllegalStateException when HTTP/1.x client options disable keep-alive but enable pipelining. Pipelining requires the connection to stay open to send multiple in-flight requests; with keep-alive disabled each connection closes after one response, making pipelining contradictory.","triggerScenarios":"Constructing TcpHttpClientTransport (via HttpClientOptions / ClientOptions building) where http1Config is non-null, isKeepAlive() is false, and isPipelining() is true.","commonSituations":"Configuring HttpClientOptions with setKeepAlive(false) while leaving setPipelining(true) (or a non-1 pipelining limit); copying an existing config and only turning keep-alive off; framework defaults enabling pipelining while the user disables keep-alive.","solutions":["Re-enable keep-alive: set keepAlive(true) on the HTTP/1.x config","Disable pipelining: setPipelining(false) / pipelining limit 1 if keep-alive must stay off","Review configuration files/env vars for a keep-alive=false override conflicting with pipelining defaults","Validate the combination at config-load time and fail with a clearer message"],"exampleFix":"// before\noptions.setKeepAlive(false).setPipelining(true); // throws\n// after\noptions.setKeepAlive(true).setPipelining(true);\n// or\noptions.setKeepAlive(false).setPipelining(false);","handlingStrategy":"validation","validationCode":"if (!http1Config.isKeepAlive() && http1Config.isPipelining()) { throw new IllegalArgumentException(\"Disable pipelining or enable keep-alive\"); }\n// then build transport","typeGuard":null,"tryCatchPattern":"try { new TcpHttpClientTransport(...); } catch (IllegalStateException e) { log.error(\"Invalid HTTP/1 options: keep-alive off with pipelining on\", e); }","preventionTips":["Keep pipelining disabled unless keep-alive is enabled","Validate HTTP client option combinations when loading config","Watch for setKeepAlive(false) overrides in external configuration"],"tags":["http","http1","client","config"],"backgroundTag":"conflicting-config-options","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"}