-
Notifications
You must be signed in to change notification settings - Fork 206
Pipelining depth grows unbounded when prepared statement is retried with explicit parameter types #1646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tsegismont
merged 8 commits into
eclipse-vertx:master
from
doxlik:prepare-with-types-inflight
May 19, 2026
+80
−0
Merged
Pipelining depth grows unbounded when prepared statement is retried with explicit parameter types #1646
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6602f13
Increment inflight counter on prepare-with-parametes-types query
doxlik 30e0ca0
Merge branch 'master' into prepare-with-types-inflight
doxlik 40119b7
test
doxlik b9a9636
Merge branch 'master' into prepare-with-types-inflight
doxlik 23523c2
Fix prepared statement reprepare inflight accounting
doxlik 7eef379
Fix prepared statement reprepare inflight accounting
doxlik a23936e
Fix prepared statement reprepare inflight accounting
doxlik 8329d55
Update vertx-sql-client-codec/src/main/java/io/vertx/sqlclient/codec/…
tsegismont File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PreparedStatementReprepareTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| package io.vertx.tests.pgclient; | ||
|
|
||
| import io.vertx.core.Vertx; | ||
| import io.vertx.ext.unit.Async; | ||
| import io.vertx.ext.unit.TestContext; | ||
| import io.vertx.pgclient.PgConnectOptions; | ||
| import io.vertx.pgclient.PgConnection; | ||
| import io.vertx.pgclient.impl.PgSocketConnection; | ||
| import io.vertx.sqlclient.Row; | ||
| import io.vertx.sqlclient.RowSet; | ||
| import io.vertx.sqlclient.Tuple; | ||
| import io.vertx.sqlclient.internal.SqlConnectionInternal; | ||
| import org.junit.After; | ||
| import org.junit.Before; | ||
| import org.junit.Test; | ||
|
|
||
| public class PreparedStatementReprepareTest extends PgTestBase { | ||
|
|
||
| private Vertx vertx; | ||
|
|
||
| @Before | ||
| public void setup() throws Exception { | ||
| super.setup(); | ||
| vertx = Vertx.vertx(); | ||
| } | ||
|
|
||
| @After | ||
| public void tearDown(TestContext ctx) { | ||
| vertx.close().onComplete(ctx.asyncAssertSuccess()); | ||
| } | ||
|
|
||
| @Test | ||
| public void testReprepareDoesNotMakeInflightNegativeWithEnabledCache(TestContext ctx) { | ||
| testReprepareDoesNotMakeInflightNegative(ctx, true); | ||
| } | ||
|
|
||
| @Test | ||
| public void testReprepareDoesNotMakeInflightNegativeWithDisabledCache(TestContext ctx) { | ||
| testReprepareDoesNotMakeInflightNegative(ctx, false); | ||
| } | ||
|
|
||
| private void testReprepareDoesNotMakeInflightNegative(TestContext ctx, boolean cachePreparedStatements) { | ||
| Async async = ctx.async(); | ||
|
|
||
| PgConnectOptions options = new PgConnectOptions(this.options) | ||
| .setCachePreparedStatements(cachePreparedStatements); | ||
|
|
||
| PgConnection.connect(vertx, options).onComplete(ctx.asyncAssertSuccess(conn -> { | ||
| PgSocketConnection socket = (PgSocketConnection) ((SqlConnectionInternal) conn).unwrap(); | ||
|
|
||
| conn | ||
| .preparedQuery("SELECT CONCAT('HELLO ', $1)") | ||
| .execute(Tuple.of("WORLD")) | ||
| .map(rows -> { | ||
| RowSet<Row> result = rows; | ||
|
|
||
| ctx.assertEquals(1, result.size()); | ||
| ctx.assertEquals("HELLO WORLD", result.iterator().next().getString(0)); | ||
|
|
||
| ctx.assertEquals( | ||
| 0, | ||
| socket.inflight(), | ||
| "Inflight count should be zero after reprepare query completion " + | ||
| "(cachePreparedStatements=" + cachePreparedStatements + ")" | ||
| ); | ||
|
|
||
| return rows; | ||
| }) | ||
| .eventually(conn::close) | ||
| .onComplete(ctx.asyncAssertSuccess(v -> async.complete())); | ||
| })); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.