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

OffsetStore not stopped if it fails to fully start

XMLWordPrintable

    • False
    • None
    • False

      In DebeziumEngine.java there is the following code:

       
      // Initialize the offset store ...
      try {
      offsetStore.configure(workerConfig);
      offsetStore.start();
      }
      catch (Throwable t) {
      fail("Unable to configure and start the '" + offsetStoreClassName + "' offset backing store", t);
      return;
      }
       

      If starting the offsetStore fails halfway through this may leak some resources, specifically this is the case for KafkaOffsetBackingStore in case the relevant kafka topic does not exist.

      What Debezium connector do you use and what version?

      1.9.5

      What behaviour do you expect?

      No leaking of resources

      What behaviour do you see?

      JMX beans statistics + threads from kafka admin clients are increasing

      Implementation ideas (optional)

      call offsetStore.stop() in the catch block.

      (alternatively you may argue that if an offsetStore fails to start it should clean up all its resources by itself ... if you do I can make a ticket and PR for kafka instead)

            Unassigned Unassigned
            domsj Jan Doms (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: