Skip to content

Commit

Permalink
Vertx4.1 fix unexpectedly connection lost issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo gonzalez granados authored and Sgitario committed May 25, 2021
1 parent bdd746d commit 6f867a5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 178 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.junit.jupiter.api.Disabled;

import io.quarkus.grpc.GrpcService;
import io.quarkus.qe.pong.GrpcPongService;
import io.quarkus.test.junit.QuarkusTest;

Expand All @@ -14,6 +15,7 @@
public class GrpcPingPongResourceTest extends AbstractPingPongResourceTest {

@Inject
@GrpcService
GrpcPongService pongService;

@Override
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import io.vertx.core.Handler;
import io.vertx.core.impl.logging.Logger;
import io.vertx.core.impl.logging.LoggerFactory;
import io.vertx.core.json.JsonArray;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import io.vertx.ext.web.client.WebClientOptions;
import io.vertx.mutiny.core.Vertx;
import io.vertx.mutiny.ext.web.client.HttpResponse;
Expand Down Expand Up @@ -74,7 +74,6 @@ public static void beforeAll() {
@Test
@DisplayName("DB connections are re-used")
@Order(1)
@Disabled("Need to double check. flaky test")
public void checkDbPoolTurnover() throws InterruptedException {
final int events = 25000;
CountDownLatch done = new CountDownLatch(events);
Expand Down Expand Up @@ -139,7 +138,7 @@ public void checkIdleExpirationTime() throws InterruptedException {
@Test
@DisplayName("Idle issue: Fail to read any response from the server, the underlying connection might get lost unexpectedly.")
@Order(3)
@Disabled("QUARKUS-719")
@Disabled("Takes too much time and is fixed by Vertx 4.1")
public void checkBorderConditionBetweenIdleAndGetConnection() {
try {
long idleMs = TimeUnit.SECONDS.toMillis(idle);
Expand Down Expand Up @@ -177,10 +176,9 @@ public void checkBorderConditionBetweenIdleAndGetConnection() {
}
}

// TODO: double check if we should care about `IDLE` state connections -> https://github.com/quarkusio/quarkus/issues/16444
private Uni<Long> activeConnections() {
return postgresql.query(
"SELECT count(*) as active_con FROM pg_stat_activity where application_name like '%vertx%' and state = 'active'")
"SELECT count(*) as active_con FROM pg_stat_activity where application_name like '%vertx%'")
.execute()
.onItem().transform(RowSet::iterator).onItem()
.transform(iterator -> iterator.hasNext() ? iterator.next().getLong("active_con") : null);
Expand Down

0 comments on commit 6f867a5

Please sign in to comment.