Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-30371

JdbcOutputFormat is at risk of database connection leaks

    XMLWordPrintableJSON

Details

    Description

      When writing to the target table fails for some reason, for example, the target table does not exist.

      The internal call sequence of JdbcOutputFormat is:
      JdbcOutputFormat#flush(throws IOException) --> JdbcOutputFormat#close --> JdbcOutputFormat#flush(throws RuntimeException).

      Will not call the close method of the database connection, when the restart strategy is fixeddelay, maxNumberRestartAttempts is Integer.MAX, this will cause the number of database connections to continue to rise and reach the limit.

       

      2022-12-07 10:49:32,050 ERROR org.apache.flink.connector.jdbc.internal.JdbcBatchingOutputFormat [] - JDBC executeBatch error, retry times = 3
      java.sql.BatchUpdateException: ORA-00942: table or view does not exist
      Caused by: java.sql.SQLException: Listener refused the connection with the following error:
      ORA-12519, TNS:no appropriate service handler found 

      Attachments

        Activity

          People

            Echo Lee Echo Lee
            Echo Lee Echo Lee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: