Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-5953

Connect classloader isolation may be broken for JDBC drivers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.11.0.0
    • 1.0.0, 1.1.0
    • connect
    • None

    Description

      Let's suppose there are two connectors deployed

      1. using JDBC driver (Debezium MySQL connector)
      2. using PostgreSQL JDBC driver (JDBC sink).

      Connector 1 is started first - it executes a statement

      Connection conn = DriverManager.getConnection(url, props);
      

      As a result a DriverManager calls ServiceLoader and searches for all JDBC drivers. The postgres driver from connector 2) is found associated with classloader from connector 1).

      Connector 2 is started after that - it executes a statement

      connection = DriverManager.getConnection(url, username, password);
      

      DriverManager finds the connector that was loaded in step before but becuase the classloader is different - now we use classloader 2) so it refuses to load the class and no JDBC driver is found.

      Attachments

        Issue Links

          Activity

            People

              kkonstantine Konstantine Karantasis
              jpechane Jiri Pechanec
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: