Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-6179

RelationalSnapshotChangeEventSource swallows exception generated during snapshot


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.2.0.Alpha3
    • None
    • core-library
    • None
    • False
    • None
    • False

      The method
      public SnapshotResult<O> doExecute(ChangeEventSourceContext context, O previousOffset,
      SnapshotContext<P, O> snapshotContext, SnapshottingTask snapshottingTask)

      swallows any exception that's generated while snapshot if the finally block throws an exception. In the finally block of the method we are doing the following

      if (connectionPool != null) {
                      for (JdbcConnection conn : connectionPool) {
                          if (!jdbcConnection.equals(conn))


      {                         conn.close();                     }



      This can very well throw an exception (for instance the rollbackTransaction method will throw an exception if  the connection is already closed. The connection can be closed if an error occurred during reading of data beforehand. Thus in this case the exception generated by finally block will suppress the original exception and as a result the original exception will be lost. 

            Unassigned Unassigned
            subodh1810 Subodh Chaturvedi (Inactive)
            0 Vote for this issue
            3 Start watching this issue