micronaut-projects / micronaut-r2dbc

Integration with R2DBC modules
Apache License 2.0
26 stars 8 forks source link

Errors in health check when try to check connection to Oracle DB #566

Open agrok opened 10 months ago

agrok commented 10 months ago

Expected Behavior

No errors

Actual Behaviour

11:18:48.665 [scheduled-executor-thread-2] DEBUG i.m.m.h.monitor.HealthMonitorTask - Starting health monitor check
11:18:48.668 [parallel-1] DEBUG io.r2dbc.pool.ConnectionPool - Obtaining new connection from the pool
11:18:52.970 [ForkJoinPool.commonPool-worker-2] ERROR reactor.core.publisher.Operators - Operator called default onErrorDropped
reactor.core.Exceptions$StaticThrowable: Operator has been terminated
11:18:52.971 [ForkJoinPool.commonPool-worker-2] ERROR reactor.core.publisher.Operators - Operator called default onErrorDropped
reactor.core.Exceptions$StaticThrowable: Operator has been terminated
11:18:52.971 [ForkJoinPool.commonPool-worker-2] DEBUG io.r2dbc.pool.PooledConnection - Releasing connection

Steps To Reproduce

start app wait 1 min when health check triggered

Environment Information

micronaut 4.1.2 Oracle DB java 17.0.9 2023-10-17 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 17.0.9+11.1 (build 17.0.9+11-LTS-jvmci-23.0-b21)

Example Application

No response

Version

4.1.2

agrok commented 10 months ago

I did some investigations

it happens in R2dbcHealthIndicator.class getResult() method. https://github.com/micronaut-projects/micronaut-r2dbc/blob/master/r2dbc-core/src/main/java/io/micronaut/r2dbc/health/R2dbcHealthIndicator.java#L77

how it works:

  1. establish connection
  2. execute query
  3. extracting query result.

those steps works well, but once it try to create mono from Map it logs error.

changing Mono.fromDirect() to Mono.from() solve the problem.

agrok commented 10 months ago

here are dependencies I use

  <dependency>
      <groupId>io.micronaut.data</groupId>
      <artifactId>micronaut-data-r2dbc</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.database.r2dbc</groupId>
      <artifactId>oracle-r2dbc</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.r2dbc</groupId>
      <artifactId>r2dbc-pool</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>io.micronaut.flyway</groupId>
      <artifactId>micronaut-flyway</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.flywaydb</groupId>
      <artifactId>flyway-database-oracle</artifactId>
      <scope>compile</scope>
    </dependency>